Tips and tricks to write LaTeX papers in with figures generated in Python
41–50 of 68 posts
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#42I would suggest checking matplotlib2tikz and matlab2tikz to get pgfplot/tikz figures from matplotlib and matlab plots
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#43Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#44One 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?
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#45Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#46Any opinion on the utility of Emacs Org-mode to organize and manage LaTeX? In particular Org Babel?
Maybe I’m doing something wrong. YMMV
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#47This is probably most useful for postgrad students getting started with writing with TeX. It’s worth pointing out that the figures are made using the matplotlib library, which is primarily based on Matlab’s plotting functionality. This is perhaps just as useful for new researchers as many of them are taught Matlab exclusively throughout their undergraduate courses.
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#48Earlier quoted context omitted.
Changing the plot backend should fix this. import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt https://stackoverflow.com/questions/2801882/generating-a-png...
I believe Agg is only for bitmap output. While there are probably backends that work with a headless system, I find the OO option much more flexible.
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#49I'd also add that for figures Inkscape is invaluable [1]. Save as svg once, and export it as whatever later. I typically export it to PDF (from within Inkscape) for pdflatex. While its typically indispensable for schematics, I often seem to run into the use case of combining previously generated plots or figures, or adding a label/text. Since Inkscape can import pngs, this is a breeze with it. I don't have to go back…
Re: Tips and tricks to write LaTeX papers in with figures generated in Python
#50Any opinion on the utility of Emacs Org-mode to organize and manage LaTeX? In particular Org Babel?
I’ve written documents in org mode and converted to pdf via LaTeX, but I find that if the document gets sufficiently complicated with formatting, I have so many LaTeX blocks in my org file I might as well be writing LaTeX directly. Maybe I’m doing something wrong. YMMV