mohd rafiq
mohd rafiq

Reputation: 19

gnuplot to gnuplot.py

Can somebody help me convert this gnuplot command to gnuplot.py

gnuplot command(works fine in gnuplot interpreter):

plot 'immigration.dat' using 2:xtic(1) ti col, '' u 3 ti col, '' u 4 ti col, '' u 5 ti col

I have tried this in file.py:

import Gnuplot

g = Gnuplot.Gnuplot(debug=1)

g.plot(Gnuplot.File('immigration.dat', using='2:xtic(1) ti col, '' u 3 ti col, '' u 4 ti col, '' u 5 ti col')) 

but results in error:"line 0: undefined variable: u", syntax issue i guess.

Upvotes: 1

Views: 857

Answers (1)

Blender
Blender

Reputation: 298532

Try this:

import Gnuplot

g = Gnuplot.Gnuplot(debug=1)

g.plot(Gnuplot.File('immigration.dat', using="2:xtic(1) ti col, '' u 3 ti col, '' u 4 ti col, '' u 5 ti col"))

You were mixing quotes.

Upvotes: 3

Related Questions