Dear Matplotlib users,
I am trying to write a script that read a variable number of data set like:
script.py set0.dat set1.dat ..... setN.dat
The problem rise in the method plt.plot() because I don't know how manage a variable number of argument.
I am wondering wether exists something like:
plt.plot([ (x0,y0,"g-"),(x1,y1,"b-"),...,(xN,yN,"b-")]
Francesco
Hi Fransesco,
This is possible indeed, from the doc:
:
you can do this:
But I would rather set up a loop:
···
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.plot
a.plot(x1, y1, 'g^', x2, y2, 'g-')
for file in sys.arv[1:]:
...
#read your data
....
plt.plot(xn,yn)
Hope this helps.
Guillaume
Dear Matplotlib users,
I am trying to write a script that read a variable number of data set like:
script.py set0.dat set1.dat ..... setN.dat
The problem rise in the method plt.plot() because I don't know how manage a variable number of argument.
I am wondering wether exists something like:
plt.plot([ (x0,y0,"g-"),(x1,y1,"b-"),...,(xN,yN,"b-")]
Francesco
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
_______________________________________________
Matplotlib-users mailing list
http://p.sf.net/sfu/Boundary-d2dvs2Matplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users
Hi Guillaume ,
actually the “loop” version fits better with my requirements.
Thanks,
Francesco
···
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.plot
a.plot(x1, y1, 'g^', x2, y2, 'g-')
for file in sys.arv[1:]:
...
#read your data
....
plt.plot(xn,yn)
Hope this helps.
Guillaume
Dear Matplotlib users,
I am trying to write a script that read a variable number of data set like:
script.py set0.dat set1.dat ..... setN.dat
The problem rise in the method plt.plot() because I don't know how manage a variable number of argument.
I am wondering wether exists something like:
plt.plot([ (x0,y0,"g-"),(x1,y1,"b-"),...,(xN,yN,"b-")]
Francesco
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
_______________________________________________
Matplotlib-users mailing list
http://p.sf.net/sfu/Boundary-d2dvs2Matplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-users