Andreas Tille writes:
> Unfortunately I have real trouble using PlotItem.
For just setting tables and line types and stuff you don't have to
extend the PlotItem interface directly; you can use the Data class
which is a type of PlotItem already customized for array data.
There are many examples in demo.py about how to use the Data class.
For example,
x = arange(10, typecode=Float)
y1 = x**2
d = Gnuplot.Data(x, y1,
title='calculated by python',
with='points 3 3')
So for your example,
> #!/usr/bin/python
>
> import Gnuplot, Gnuplot.funcutils
>
> X = []
> Y = []
> for x in range(32):
> X.append((x, 2*x ))
> Y.append((x, 3*x ))
>
> g = Gnuplot.Gnuplot(debug=1)
>
> g.plot(X, Y)
> raw_input('Please press return to continue...\n')
You would do something like the following (untested):
g.plot(
Gnuplot.Data(X, title='This is the X dataset', with='linespoints'),
Gnuplot.Data(Y, title='Some more data', with='points 2 5'),
)
> PS: I'm not yet subscribed to this list and would be happy about a CC
> because a list archive does not seem to be available.
Please subscribe. The list has an archive but since the list is very
new there are only a few messages in it.
Michael
--
Michael Haggerty
hag...@jp...
|