gnuplot on Canvas widget

Fernando Perez fperez.net at gmail.com
Thu Jan 27 19:23:24 EST 2005


Jonathan  Ellis wrote:

> Blues wrote:
>> I have used two great models - Tkinter and Gnuplot.py - for a while.
> I
>> can display an image on a Canvas widget using Tkinter and I can also
>> generate a gnuplot from Python on the fly in a separate window.  Does
>> anyone know how to display such a gnuplot on the Canvas widget with
> an
>> image in it?  Thanks.
> 
>>From my experience, the Gnuplot module isn't designed to be used in
> "headless" mode -- it can save to the usual formats, but you have to
> render everything in an x11 window interactively first.
> It might not be hard to modify this, though.

That's not correct.  I have tons of Gnuplot.py based scripts which write
directly to EPS output, without ever opening a gui window.  Note that Gnuplot
still tries to initialize the X11 terminal at startup, so they would require
modifications to run over ssh without X forwarding.

The default plot() command in Gnuplot.py doesn't make it too convenient to do
this, but it's possible.  The Gnuplot support in ipython
(http://ipython.scipy.org) extends the syntax of  the plot() command to make
it trivial to render to EPS without a terminal.  It shouldn't be hard to
modify this to render to other formats, while avoiding opening an X11 window.

Best,

f




More information about the Python-list mailing list