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 
> here<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=Y2hhb3l1ZWpveUBnbWFpbC5jb218MnwxMzg1NzAzMzQx>
> .
> NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=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

Reply via email to