Re: [Matplotlib-users] Multiple XY plots

2013-02-27 Thread lkz2366
Ok, I finally got it working after a couple of hours of experimenting.  I
couldn't figure out how to get your methods to work, maybe because I'm such
a novice at Python.  But, it was as easy as using a simple 'for' loop.


num = the number of lists to plot

time = a list of lists
volts = a list of lists


figure()
for x in range(0,num):
 plot(time[x],volt[x])
show()

http://matplotlib.1069221.n5.nabble.com/file/n40498/screenshot.png 



--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/Multiple-XY-plots-tp40451p40498.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Multiple XY plots

2013-02-20 Thread ChaoYue
Hi,

could you use a loop to solve it?

arr1list = [np.arange(10) + i for i in range(10)]
arr2list = [np.arange(10) -i for i in range(10)]

for arr1,arr2 in zip(arr1list,arr2list):
plot(arr1,arr2)

you can use a more object oriented way:

fig = plt.figure()
ax = fig.add_subplot()
for arr1,arr2 in zip(arr1list,arr2list):
ax.plot(arr1,arr2)

code not tested.

cheers,

Chao
On Thu, Feb 21, 2013 at 4:17 AM, lkz2366 [via matplotlib] 
ml-node+s1069221n40451...@n5.nabble.com wrote:

 I am confused on how to plot a variable number of XY plots on a single
 chart.  I want to superimpose XY plots on a single chart but the number of
 plots is unknown until runtime.
 For example, if I want to plot 4 plots the code would be:
 figure()
 plot(x1,y1,x2,y2,x3,y3,x4,y4)
 show()

 But the number of plots is variable and could be anywhere from 5-30.  Any
 ideas on how I can do this?
 I already have the rest of my program working. The program reads all of
 the data from all of the files in a target directory and writes the data to
 X and Y lists.
 Thanks for any help.

 --
  If you reply to this email, your message will be added to the discussion
 below:
 http://matplotlib.1069221.n5.nabble.com/Multiple-XY-plots-tp40451.html
  To start a new topic under matplotlib - users, email
 ml-node+s1069221n...@n5.nabble.com
 To unsubscribe from matplotlib, click 
 herehttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=2code=Y2hhb3l1ZWpveUBnbWFpbC5jb218MnwxMzg1NzAzMzQx
 .
 NAMLhttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




-- 
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16





--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/Multiple-XY-plots-tp40451p40453.html
Sent from the matplotlib - users mailing list archive at Nabble.com.--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users