changing the viewing area with gnuplot in python

Fernando Pérez fperez528 at yahoo.com
Thu Jun 20 12:29:30 EDT 2002


Nathan Given wrote:

> right now gnuplot auto scales everything (I don't have control over the
> viewing area)...
> 
> 
> How do I change it?  (I want to view from -4 to 2 on the x axis, and 0
> to 10 on the y axis....  right now gnuplot automatically chooses -4 as
> xmin, 2 as xmax, 4 as ymin, and 10 as ymax)

Assuming 'g' is your gnuplot instance:

g('set xrange [-4:2]')
g('set yrange [0:10]')

Open a gnuplot session in a separate terminal and use its builtin help. Once 
you figure out which commands you need interactively, you can just pass them 
to the python-controlled gnuplot by calling it as a function with the command 
you want in a string.

cheers,

f.



More information about the Python-list mailing list