Closed jdleg closed 10 years ago
Good question, @jdleg. A few suggestions:
figure(num=None, figsize=(8, 6), dpi=80, facecolor='w', edgecolor='k')
(grabbed this quick example from Stack Overflow, but here is the official documentation)plt.savefig('myplot.png')
or plt.savefig('myplot.pdf')
to save plots for later use (the documentation for this can be found here).DPI is a very important detail here. Matplotlib plots were originally built to be pretty low quality in terms of print, but very easily injectable into say a journal article. In academia, you'll see matlib/matplotlib style charts frequently. I'm also kinda familiar with prism, which you'll see has a relatively similar style.
For presentations, I usually do everything on the chart itself. Crispness isn't a concern as along as it's readable. If you go to data meetups you'll often see matplotlib or ggplot in the presentations.
@datadave and I discussed earlier last week that we may do another lecture on more advanced matplotlib work, especially so you all feel really comfortable with your ability to present data accurately and clearly, so expect this after the machine learning section.
Thanks, Joe! That's exactly what I was looking for. I didn't know about dpi settings, and probably should get familiar with the matplotlib documentation. People in class advised me to use the snipping tool for figures, which has turned out to be very effective. Are files created with the save commands inherently better in terms of image quality, or only in that they're generated programmatically?
Thanks to Ed also! Your perspective is really informative - I am used to seeing matplotlib and ggplot in the small print, but not from the production side. I will have to check out Prism. (Is it like Tableau in its functionality?)
I would definitely be interested in another lecture on advanced matplotlib.
This is not so much an issue as a question. Python packages can be used to create labeled figures and tailor how they appear. However, you can also copy unlabeled figures into another app (e.g., PowerPoint), and in my (very limited) experience, the labels and headers you generate there are crisper.
Based on experience in data science, what method(s) work(s) best? Is there software you would recommend for creating a "deck?" Is it important to learn how to manipulate the appearance of graphs from within Python (presuming clear/attractive graphs are a desired endpoint)?