1

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.

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Great! thanks, i just checked it with a sleep(), thanks again

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.