Plotting in batch with no display

Giacomo Boffi giacomo.boffi at polimi.it
Tue Jun 8 05:41:01 EDT 2010


Hans Georg Schaathun <H.Schaathun at surrey.ac.uk> writes:

> :      import matplotlib
> :      matplotlib.use('agg')
> :      import pylab
> :      pylab.plot([1, 3, 5])
> :      fig = file('foo.png', 'wb')
> :      pylab.savefig(fig, format='png')
> :      fig.close()
>
> Raster graphics is not good enough

#ig = file('foo.png', 'wb'
pylab.savefig('foo.png', format='pdf')

that's all



More information about the Python-list mailing list