Hi,
I am just about to find out how python and gnuplot work together. On
http://wiki.aims.ac.za/mediawiki/index.php/Python:Gnuplot_module
I found an introduction and I wanted to execute it on my Ubuntu machine.
import Gnuplot
gp = Gnuplot.Gnuplot(persist = 1)
gp('set data style lines')
data1 = [[0, 0], [1, 1], [2, 4], [3, 9], [4, 16]] # The first data set (a quadratic)
data2 = [[0, 0], [1, 1], [2, 2], [3, 3], [4, 4]] # The second data set (a straight line)
plot1 = Gnuplot.PlotItems.Data(data1, with_="lines", title="Quadratic")
plot2 = Gnuplot.PlotItems.Data(data2, with_="points 3", title=None) # No title
gp.plot(plot1, plot2)
However, I get the following error message:
./demo.py
./demo.py: line 2: syntax error near unexpected token ('
gp = Gnuplot.Gnuplot(persist = 1)'
./demo.py: line 2:
any idea what could be wrong here? To install gnuplot support for python I installed python-gnuplot. Do I miss another package?