On Fri, Apr 11, 2008 at 6:21 PM, zhang chi <zha...@gm...> wrote:
> g = Gnuplot.Gnuplot(debug=1)
> g('set key left box')
> g('set samples 50')
> g.plot([[-10:10]],sin(x),atan(x),cos(atan(x)))
> time.sleep(5)
According to Gnuplot documentation (try "help(Gnuplot.Gnuplot.plot)"),
the arguments to the plot() has to be either a PlotItem object or a
string (or something that can be convertible to those).
Changing the g.plot command to
g.plot('sin(x)', 'atan(x)', 'cos(atan(x))')
seems to work, and it seems rather silly to specify [-10:10], given
that that's the default range, but if you need to, you can probably do
it by issuing a command to set xrange to what you want.
Regards,
Andrzej
P.S. I think py-gnuplot has many of the common functions and methods
built-in---what you have here as raw gnuplot command probably can be
written in terms of methods provided by py-gnuplot, although the end
result is more or less the same.
|