0

I've a python script that gives me 2 lists and another who is the reference(the time). How can I create a graphic with the representation of my first list by the time. And same question for the second list. I need them on the same graphic.

list1 [12, 15, 17, 19]

list2 [34, 78, 54, 67]

list3 [10, 20, 30, 40] (time in minutes)

How can I create a graphic in png format with these lists?

Thanks

1
  • 1
    Maybe you should search the web for "Python plotting" or similar first, and come back if you have a specific problem. Commented Apr 7, 2012 at 11:29

1 Answer 1

1

first you need this package http://gnuplot-py.sourceforge.net/, then run these codes:

import Gnuplot
g=Gnuplot.Gnuplot()
y1= [12, 15, 17, 19]
y2= [34, 78, 54, 67]
x= [10, 20, 30, 40] 
d1=Gnuplot.Data(x,y1,with_="line")
d2=Gnuplot.Data(x,y2,with_="line")
#g.plot(d1,d2)   #uncomment this line if you want to see the gnuplot window
g.hardcopy('filename.png',terminal = 'png')
Sign up to request clarification or add additional context in comments.

1 Comment

Just perfect. Thanks Bigeagle :)

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.