Hi

In one of my codes I need to plot several time series from different
files, the files are of the form

20100118 10
20100119 12
20100120 14
20100121 16
20100126 18
20100221 25
20100222 25
20100227 26
20100228 30

I use something like the following to plot these:

morning = numpy.loadtxt(morning_file, converters={0: dates.datestr2num})
morning_plot = date_axes.plot_date(morning[:,0], morning[:,1], 'bo-', ms=4)

However sometimes these files only contain a single line and my script
fails with an error:

Traceback (most recent call last):
  File "./plot.py", line 119, in <module>
    morning_plot = date_axes.plot_date(morning[:,0], morning[:,1], 'ro-', ms=4)
IndexError: invalid index

Is there a way that I can plot these files regardless of whether they
contain multiple or single lines?

Cheers

Adam

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to