The beautiful thing about matplotlib is that it is infinitely customizable and has great default settings. However, it is worth looking at the matplotlibrc file to change some of the default settings. The file is heavily and wonderfully annotated, so you know exactly what you’re changing as you do it. I played around with it a bit and settled on what I like as my new default settings. I mostly changed text sizes and the widths of the axes (which I felt were too thin).
Here’s what I recommend:
- figure.figsize : 6.5, 5.5 – I like the figure size of 6.5 x 5.5. I don’t know why. It’s a holdover from how I made R graphs and I’ve gotten used to it
- legend.numpoints : 1 – get rid of the double points in pylab’s legend. I have no idea why the default is 2. It always looked funny.
- legend.fontsize : 12 – reduces the legend font size. I found that the legend was taking up most of my plot
legend.handletextpad : 0.2 – reduce the white space between legend points and legend text
- ytick.major.width : 1 – increase the thickness of the tick lines
ytick.minor.width : 1 – same as above
- xtick.major.width : 1 -again
xtick.minor.width : 1
- axes.axisbelow : True – puts the grid BELOW the elements (rather than overtop of them)
- axes.linewidth : 1.5 – gives the axes a thicker line. I think this makes the graph pop a little more
If you save images as PNG or JPG, it’s also worth changing the DPI to something higher (the default is 50). Since I use PDF, this isn’t really an issue.
Here’s the final result:
Now, if only I could get the TeX font not to look ugly as sin and figure out how to make minor ticks turn on by default..