Hacker News new | ask | show | jobs
by abhgh 2655 days ago
I'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 to the original code to regenerate plots, or fiddle around with latex to make minor adjustments.

For stuff generated via matplotlib, I'd strongly recommend seaborn as an additional library [2]. This is a wrapper over matplotlib. It can prettify plots with just an import and a 'set' command. You can, of course, use it to plot too, and for stuff doable in matplotlib using the seaborn alternative is much easier and looks better with little or no work. And they support pandas dataframes.

[1] https://inkscape.org/

[2] https://seaborn.pydata.org/

3 comments

The problem with inkscape is that, any slight changes to the figures would make the user go deep into the workflow pipeline to make the changes. However using LaTeX packages like TikZ or PSTicks would simplify the workflow and make the document more maintainable.
I think this is one of those things that depend on your actual workflow, content etc. I see your point; for me this hasn't been a problem.
Have you considered plotly [1] as an alternative to matplotlib?

It is mostly known for online plots but it has a free offline API that can export plots to eps/pfd/png/etc.

Parts of their libraries are aimed for interactive plots but imo the basic plots look even better than those of seaborn.

[1] https://plot.ly/python/

I do this as well. And you can save svg files from matplotlib for editing or composition in Inkscape!