[SciPy-Dev] TimeSeries Plotting Broken?
Dave Hirschfeld
dave.hirschfeld@gmail....
Mon Nov 8 04:11:25 CST 2010
I get the following error when trying to run the "Separate scales for left and
right axis" example from the scikits.timeseries website:
Executing Python(x,y) 2.6.5.3 profile startup script: default.py
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)]
IPython 0.10 -- An enhanced Interactive Python.
In [2]: numpy.__version__
Out[2]: '1.5.1rc1'
In [3]: ts.__version__
Out[3]: '0.91.3'
In [4]: matplotlib.__version__
Out[4]: '1.0.0'
In [5]: import numpy as np
In [6]: import numpy.ma as ma
In [7]: import matplotlib.pyplot as plt
In [8]: import scikits.timeseries as ts
In [9]: import scikits.timeseries.lib.plotlib as tpl
In [10]:
In [11]: # generate some random data
In [12]: data1 = np.cumprod(1 + np.random.normal(0, 1, 300)/100)
In [13]: data2 = np.cumprod(1 + np.random.normal(0, 1, 300)/100)*100
In [14]: start_date = ts.Date(freq='M', year=1982, month=1)
In [15]: series1 = ts.time_series(data1, start_date=start_date-50)
In [16]: series2 = ts.time_series(data2, start_date=start_date)
In [17]: fig = tpl.tsfigure()
In [18]: fsp = fig.add_tsplot(111)
In [19]: # plot series on left axis
In [20]: fsp.tsplot(series1, 'b-', label='<- left series')
Out[20]: [<matplotlib.lines.Line2D object at 0x03046F90>]
In [21]: fsp.set_ylim(ma.min(series1.series), ma.max(series1.series))
Out[21]: (0.83169831486028944, 1.0802663771556904)
In [22]: # create right axis
In [23]: fsp_right = fsp.add_yaxis(position='right', yscale='log')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
scikits.timeseries-0.91.3-py2.6-win32.egg\scikits\timeseries\lib\plotlib.pyc
in add_yaxis(fsp, position, yscale, basey, subsy)
1194 fig = fsp.figure
1195 axisini = fsp.axis()
-> 1196 fsp_alt_args = (fsp._rows, fsp._cols, fsp._num + 1)
1197 fsp_alt = fig.add_tsplot(frameon=False, position=fsp.get_position(),
1198 sharex=fsp, *fsp_alt_args)
AttributeError: 'TimeSeriesPlot' object has no attribute '_rows'
Let me know if there's anything further I can do to help getting it fixed...
Thanks,
Dave
More information about the SciPy-Dev
mailing list