On Wed, Jun 25, 2008 at 7:31 AM, eShopping <[EMAIL PROTECTED]> wrote: > Hi Darren > > thanks for the quick reply. I tried > > self.lines[0][0].set_data((self.data.xa,self.data.ya)) > self.lines[0][1].set_data((self.data.xa,self.data.ys)) > > but got the error 'list index out of range' after the second > statement. I also tried > > self.lines[0][0].set_data((self.data.xa,self.data.ya)) > self.lines[1][0].set_data((self.data.xa,self.data.ys)) > > There were no errors in this case but the data does not plot > correctly. Finally, I tried > > self.lines[0][0].set_xdata(self.data.xa) > self.lines[0][0].set_ydata(self.data.ya) > self.lines[1][0].set_xdata(self.data.xa) > self.lines[1][0].set_ydata(self.data.ys) > > but matplotlib complained that 'xdata and ydata must be the same > length' after executing the first of these statements (presumably > because the new xa array has a different number of elements than the > old ya array)
The self.lines[0][1] idiom is really ugly. Avoid it with Darren't first suggestions:: self.lines.extend(ax.plot(something)) If the xdata or ydata change in size, you will need to set them both simultaneously: line.set_data(xdata, ydata) JDH ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users