another noob question

Any help appreciated

I am displaying a line on a map ala

···

--------------
m=Basemap( .... )
xpt,ypt= m([],[])
outlines=m.plot(xpt,ypt,'r-')
-----------------
and then in an update routine I do

----------------
def update(newxpts,newypts):
    outlines[0].set_data(newxpst,newypts)
-----------------------

This works fine but now I want to add additional lines. I tried

--------------------
m=Basemap( .... )
xpt,ypt= m([],[])
outlines=m.plot(xpt,ypt,'r-')
slitlines=[]
for i in range(0,500):
    slitlines.append(m.plot([],[],'b-'))
------------------------

and

------------------------
def update(newxpts,newypts,newslitx,newlity):
    outlines[0].set_data(newxpst,newypts)
     for i in range(0,500):slitlines[i][0].set_data([startx[i],endx[i]],[starty[i],endy[i]])
-------------------------

but this doesn't work. Clearly I'm doing something wrong.
Whats the best way to do this?

Thanks
Mathew

I had a bug in my code, when I fixed it I can now see the lines.
If there is a better way to do what I'm doing, and love to hear it.

Mathew Yeates wrote:

···

Any help appreciated

I am displaying a line on a map ala
--------------
m=Basemap( .... )
xpt,ypt= m([],[])
outlines=m.plot(xpt,ypt,'r-')
-----------------
and then in an update routine I do

----------------
def update(newxpts,newypts):
    outlines[0].set_data(newxpst,newypts)
-----------------------

This works fine but now I want to add additional lines. I tried

--------------------
m=Basemap( .... )
xpt,ypt= m([],[])
outlines=m.plot(xpt,ypt,'r-')
slitlines=[]
for i in range(0,500):
    slitlines.append(m.plot([],[],'b-'))
------------------------

and

------------------------
def update(newxpts,newypts,newslitx,newlity):
    outlines[0].set_data(newxpst,newypts)
     for i in range(0,500):slitlines[i][0].set_data([startx[i],endx[i]],[starty[i],endy[i]])
-------------------------

but this doesn't work. Clearly I'm doing something wrong.
Whats the best way to do this?

Thanks
Mathew
         
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users