[SciPy-user] scikit.timeseries plotting bugs?

Dharhas Pothina Dharhas.Pothina@twdb.state.tx...
Thu Dec 4 10:10:18 CST 2008


I'm trying to make some plots with two different timeseries on them and have come across some strange behavior. I have two timeseries, one is every 15 mins and the other is daily averages created from the 15 minute series (fseries & fseries_freq).

If I use two commands and '.', 'b+' or as the symbol for the first series it works, ie :

fsp1.tsplot(fseries, '.')
fsp1.tsplot(fseries_freq, 'r--')

If I use two commands and certain other symbols like 'b',b--' etc for the first series, it only plots the second series :

fsp1.tsplot(fseries, 'b.')
fsp1.tsplot(fseries_freq, 'r--')

If I combine the two in one command as shown in the moving average plotting example in the documentation it only shows the second series whatever I put as the symbol in the first series. ie :

fsp2 = fig2.add_tsplot(111)
fsp2.tsplot(fseries, '.',fseries_freq, 'r--')

Am I missing something or is this a bug. Also the plots are fairly slow, is that just the overhead of plotting through the timeseries package?

- dharhas

Entire Code Below:

year, month, day, hour, minute, fdata = loadtxt(fieldfile,comments="#",usecols=(0,1,2,3,4,ndata),unpack=True)
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)]
fdates = ts.date_array(fielddates,freq='MIN')
fseries = ts.time_series(fdata, dates=fdates)

#remove -999.9 nodata values fo parameter
fseries[fseries==-999.9] = ma.masked
fseries = fseries.fill_missing_dates()
#convert tor required frequency
fseries_freq = fseries.convert(freq=freq, func=mean) 
fig1 = tpl.tsfigure()
fsp1 = fig1.add_tsplot(111)
fsp1.tsplot(fseries, '.')
fsp1.tsplot(fseries_freq, 'r--')

fig2 = tpl.tsfigure()
fsp2 = fig2.add_tsplot(111)
fsp2.tsplot(fseries, '.',fseries_freq, 'r--')

More information about the SciPy-user mailing list