High-resolution-figures with seaborn and matplotlib
Posted on Sat 31 March 2018 in python
Often we run into issues of generating high-resolution figures for publication, and, it is a bit of pain. Let me explain a couple of points which made me write this post.
Seaborn (sns)
is an awesome tool to do the plottingMatplotlib
is needed to do nitty-gritty changes in Seaborn plots- But saving
sns
figures (directly in.png
format) with matplotlib changes does a poor job of rendering
However, if we take some extra steps then it is possible to get all of we need:
- First save the figure in
pdf
format - Try to use third-party tools (
ImageMagik
) to convertpdf
topng
Please see the implementation here
A figure with detailed use of matplotlib in searborn plots can been viewed
here.
All panels except a
is generated using seaborn customized with matplotlib.
Codes are available here; see
HT_data_analyses
and Shape_analyses
directories.
Credits: Saket Choudhary