[SciPy-user] scikit.timeseries plotting bugs?

Dharhas Pothina Dharhas.Pothina@twdb.state.tx...
Fri Dec 5 11:26:10 CST 2008


I'm attaching a ascii datafile called JDM3_short.txt and the commands I typed in ipython to reproduce the problem. The first figure works the second has the correct axes but is blank.

In [2]: import sys
In [3]: import subprocess
In [4]: from numpy import *
In [5]: from pylab import *
In [6]: import datetime
In [7]: import scikits.timeseries as ts
In [8]: import scikits.timeseries.lib.plotlib as tpl
In [9]: import numpy.ma as ma
In [10]: fieldfile='JDM3_short.txt'
In [11]: year, month, day, hour, minute, fdata = loadtxt(fieldfile,comments="#",usecols=(0,1,2,3,4,8),unpack=True)
In [12]: fielddates = [datetime.datetime(int(y),int(m),int(d),int(hh),int(mm),0) for y,m,d,hh,mm in zip(year,month,day,hour,minute)]
In [13]: fdates = ts.date_array(fielddates,freq='MIN')
In [14]: fseries = ts.time_series(fdata, dates=fdates)
In [15]: #remove -999.9 nodata values fo parameter
In [16]: fseries[fseries==-999.9] = ma.masked
In [17]: 
In [18]: fseries = fseries.fill_missing_dates()
In [19]: fig = tpl.tsfigure()
In [20]: fsp = fig.add_tsplot(111)
In [21]: fsp.tsplot(fseries, '.')
Out[21]: [<matplotlib.lines.Line2D object at 0x23cafd0>]
In [22]: fig1 = tpl.tsfigure()
In [23]: fsp1 = fig1.add_tsplot(111)
In [24]: fsp1.tsplot(fseries, 'b', label='data')
Out[24]: [<matplotlib.lines.Line2D object at 0x3109650>]
In [25]: show()

- dharhas

>>> "Dharhas Pothina" <Dharhas.Pothina@twdb.state.tx.us> 12/05/08 10:42 AM >>>

Ok I've narrowed it down. It has nothing to do with plotting two timeseries. The problem is plotting the any of the original timeseries I read from files. Once I convert them to daily means the plotting works fine.

With the original timeseries whether it plots or not seems to depend on what plotting symbol I use.

- dharhas

>> If I use two commands and certain other symbols like 'b',b--' etc  
>> for the first series, it only plots the second series :
> ??? can't reproduce this one...

I've double checked, its happening consistently with multiple datasets (The datasets are similar just at different locations). How do I track down the problem? Should I send you a datafile and my short script?

SciPy-user mailing list

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: JDM3_short.txt
Url: http://projects.scipy.org/pipermail/scipy-user/attachments/20081205/fc2e566d/attachment.txt 

More information about the SciPy-user mailing list