Hi
Need some basic help with Gnuplot.py - it must a simple thing I'm not
getting.
I can't get xrange to work as expected, the axis shifts, but the data
doesn't get plotted accordingly. Best explained with an example. If
you enter the following in gnuplot directly/interactively:
----------------------
gnuplot> set xrange[-5:5]
gnuplot> plot x*x
----------------------
This is what I want to be able to do via a python script where I pass in
the data for x and y in list.
I have the following code:
-------------------
#!/usr/bin/env python
import Gnuplot
g = Gnuplot.Gnuplot(debug=1)
x = range(-5,5)
y = []
for i in x:
y.append(i*i)
g('set style data linespoint')
#g('set xrange[-5:5]')
g.plot(y)
-------------------
the plot is centered around 5 (tick marks go from 0 to 10). If I use
g('set xrange[-5:5]')
to center it around 0, I only get half of the graph (tick marks go
from -5 to 5).
I also tried g.plot(x, y) w/o luck
Is there a way to get this to work as the interactive gnuplot example
above does?
I think I may be missing something obvious ...
Thanks!