[SciPy-user] Still having plotting issue with latest svn scikits.timeseries

Dharhas Pothina Dharhas.Pothina@twdb.state.tx...
Wed Dec 10 11:32:26 CST 2008


I pulled this into a separate thread since the earlier one had too many different things in it.

When I read a datafile in and try to plot it, Whether it plots correctly or not depends on what symbols I use in the plot. I think but I haven't exhaustively checked that the problem occurs for symbols that require some sort of interpolation ie lines, dashed lines etc. In these cases the axes are correct but the plot is blank. Symbols like dots or pluses seem to work fine.

If I convert the timeseries using the .convert or .asfreq methods the plots work without a problem. Since I can plot after converting using .asfreq this isn't too much of a problem but I was wondering if there is a bug or whether a warning should be thrown.

The dataset and commands I used are below.


- dharhas

>>> "Dharhas Pothina" <Dharhas.Pothina@twdb.state.tx.us> 12/5/2008 11:26 AM >>>

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?

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: JDM3_short.txt
Url: http://projects.scipy.org/pipermail/scipy-user/attachments/20081210/7c4ebd52/attachment.txt 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Part.002
Type: application/octet-stream
Size: 151 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20081210/7c4ebd52/attachment.obj 

More information about the SciPy-user mailing list