OK. EPS output and convert to PDF afterwards:
pylab.savefig('myfig.eps')
dum,my=os.popen('epstopdf myfig.eps')
A bit cumbersome; the converted eps figs look murky on some pdf viewers, but they print out OK.
Edit (02/2012): Being less ignorant about the matplotlib by now, I'd also recommend tweaking the figure's default parameter set, e.g.:
from matplotlib import pyplot as pl
import matplotlib
para = { 'axes.labelsize': 14, 'text.fontsize': 8, 'legend.fontsize': 11, 'xtick.labelsize': 10, 'ytick.labelsize': 10, 'figure.subplot.left' : 0.12, 'figure.subplot.right' : 0.98, 'figure.subplot.bottom' : 0.11, 'figure.subplot.top' : 0.97}
pl.rcParams.update(para)
Or, even easier, use the pyplot.subplots_adjust() method for on-the-fly modification. Savefig to PDF should yield decent results without the EPS workaround.
import matplotlib
para = { 'axes.labelsize': 14, 'text.fontsize': 8, 'legend.fontsize': 11, 'xtick.labelsize': 10, 'ytick.labelsize': 10, 'figure.subplot.left' : 0.12, 'figure.subplot.right' : 0.98, 'figure.subplot.bottom' : 0.11, 'figure.subplot.top' : 0.97}
pl.rcParams.update(para)
No comments:
Post a Comment