Plotting in batch with no display

Hans Georg Schaathun H.Schaathun at surrey.ac.uk
Fri Jun 4 16:01:00 EDT 2010


Admittedly not the strongest reason, but yet an important one,
for switching from Matlab to python/numpy/scipy/matplotlib,
is that Matlab is very cumbersome to run in batch.

Now I discover that some of the matplotlib.pyplot functions
(incl. plot and contour) insist on opening an X11 window 
(just like Matlab does).  I would have preferred just to create 
the plot straight on file.  The extra window is a nuisance on my 
laptop, it is deep-felt pain if I try to run it remotely.  It fails
completely if I run it without any display at all.

Oddly, the bar() function does not open a window by default.
I was very happy with that.  It works exactly the way I want.
(Why isn't pyplot more consistent?)

Is there something I have missed?  Is it possible to create
standard 2D plots and contour plots without a display, writing
the graphics straight into a PDF file?

I'll be grateful for any pointers and ideas,
:-- George



More information about the Python-list mailing list