TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Creating publication-quality figures with Matplotlib

38 pointsby mandorover 10 years ago

5 comments

soniumover 10 years ago
I use Matplotlib for my publications written in latex. Matplotlib can also render via a latex backend, which gives you then matching fonts and symbols in the text and figure by using something as simple as:<p>rc(&#x27;text&#x27;, usetex=True) matplotlib.rcParams[&#x27;text.latex.preamble&#x27;] = [&#x27;\\usepackage{siunitx}&#x27;]<p>Here is an example from my own publication, with 100% Matplotlib and latex:<p><a href="http://scitation.aip.org/content/aip/journal/apl/104/9/10.1063/1.4867908" rel="nofollow">http:&#x2F;&#x2F;scitation.aip.org&#x2F;content&#x2F;aip&#x2F;journal&#x2F;apl&#x2F;104&#x2F;9&#x2F;10.10...</a><p>A clear advantage using Matplotlib is reusability as opposed to the time needed to set the plotting parameters right for every single figure over and over. I would really recommend this kind of workflow to anyone in academic publishing.
评论 #9044082 未加载
评论 #9044632 未加载
评论 #9045269 未加载
pbskover 10 years ago
Seaborn is now my goto plotting library for python. It&#x27;s built on Matplotlib but with default themes and colour palettes that are much better out of the box and rarely require modification.<p>It plays nicely with pandas dataframes and has a number of useful built-in plots.<p><a href="http://stanford.edu/~mwaskom/software/seaborn/" rel="nofollow">http:&#x2F;&#x2F;stanford.edu&#x2F;~mwaskom&#x2F;software&#x2F;seaborn&#x2F;</a> <a href="http://stanford.edu/~mwaskom/software/seaborn/tutorial/plotting_distributions.html" rel="nofollow">http:&#x2F;&#x2F;stanford.edu&#x2F;~mwaskom&#x2F;software&#x2F;seaborn&#x2F;tutorial&#x2F;plott...</a> <a href="http://stanford.edu/~mwaskom/software/seaborn/tutorial/timeseries_plots.html" rel="nofollow">http:&#x2F;&#x2F;stanford.edu&#x2F;~mwaskom&#x2F;software&#x2F;seaborn&#x2F;tutorial&#x2F;times...</a>
评论 #9045281 未加载
kevin_thibedeauover 10 years ago
Matplotlib is awesome. I just wish the API was cleaner:<p><pre><code> figure.set_frameon() axis.set_frame_on() pyplot.xlim() axis.set_xlim() </code></pre> This is really pain to deal with when you convert a plot into a subplot and have to switch to the different axis API. Some of this is damage from copying Matlab&#x27;s legacy but it could use a polish. If you don&#x27;t use an editor with IntelliSense you have to constantly look up methods in the docs to find the right spelling.
wodenokotoover 10 years ago
They look good, but the amount of code is staggering!
评论 #9044667 未加载
评论 #9044348 未加载
评论 #9044232 未加载
emp_zealothover 10 years ago
Will there be any way to integrate it with Octave?