I also recommend separating repetitive parts of plot generating code into template files, such as with mako or jinja2, and then programmatically generate sequences of plots by first piping the data into the jinja2 template, and then using insert commands to insert it into a bigger tex document. I found this helpful when writing a paper where the appendix needed over 35 different tables of regression results, all with…
Tips and tricks to write LaTeX papers in with figures generated in Python
21–30 of 68 posts
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#22I have one tip for anyone using LaTeX: Please stop using the awful Computer Modern typeface.
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#23Thanks for the write-up! Two notes from my experience: pgf output works well with latex as well (although will slowdown compilation), and I recommend not using the pyplot submodule, especially if you'll be running things remotely over ssh and don't have a display
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#24One itch which (curiously) I can't seem to quite scratch in LaTeX is that it should be possible to say "plot equation \ref{eq:smth} for X in (-4,4)" and just get the bloody graph. Why should I need to define the equation again in a separate place, perhaps even in a separate file?
I wouldn't be surprised if someone wrote a tool that allows you to use a reference to an equation as the function to plot :).
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#25I have one tip for anyone using LaTeX: Please stop using the awful Computer Modern typeface.
Apart from personal preference, why avoid Computer Modern?
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#26Then you can use savefig when it looks good. Then save the code you used into some file near the Latex sources.
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#27> When writing LaTeX documents, put one sentence per line in your source file. An interesting tip, never thought of that! It changes the way you write a bit, but it does make finding changes easier, finding errors easier, and forces you to think more about each sentence since you have to hit "enter" at the end of each one.
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#28Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#29I have one tip for anyone using LaTeX: Please stop using the awful Computer Modern typeface.
Any typeface in particular that you do recommend?
My resume is typeset in Linux Libertine [2] which is used in this superlatively beautiful and elegant CV template by Dario Taraborelli [3]. Requires xelatex.
[1] http://www.tug.dk/FontCatalogue/charterbt/
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#30I have one tip for anyone using LaTeX: Please stop using the awful Computer Modern typeface.
I personally find Computer Modern quite pleasant to read and work with. Apart from personal preference, why avoid Computer Modern?
Just kidding, but I got my degree 25 years ago, and at the time, the students who tried to have a perfectly typeset document spent a lot of time on that pursuit.