[SciPy-user] scikits.timeseries fill between two curves

Dharhas Pothina Dharhas.Pothina@twdb.state.tx...
Mon Mar 9 09:31:42 CDT 2009


Thank you. I had to upgrade matplotlib since fill_between isn't part of 0.98.3 which is what I had installed.

- dharhas

>>> Pierre GM <pgmdevlist@gmail.com> 3/6/2009 3:11 PM >>>
Dharhas,
Not directly, but there is some workaround. After all, a  
TimeSeriesPlot is only a subclass of SubPlot, so all its methods are  
available. Keep in mind that the dates are just an array of integers  
used for the xaxis. You can access it with the `xdata` attribute.
For example, the following code works:

from scikits.timeseries.lib import moving_funcs as mf
import scikits.timeseries.lib.plotlib as tpl

coseries = ts.time_series(np.cos(np.arange(36)),
                           start_date=ts.Date('M', '2001-01'))
snseries = ts.time_series(np.cos(np.arange(36)+3),
                           start_date=ts.Date('M', '2001-01'))
tpl.tsplot(series=coseries)
fsp = tpl.gca()
fsp.tsplot(snseries)
fsp.fill_between(fsp.xdata, coseries, snseries, color='grey')




On Mar 6, 2009, at 3:26 PM, Dharhas Pothina wrote:

> Hi,
>
> I was wondering if there was a way to shade the region between two  
> curves on a scikits.timeseries plot. I see that matplotlib has a  
> fill_between() function and I was wondering if there was a way to  
> use that in a tsplot.
>
> Thanks
>
> - dharhas
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org 
> http://mail.scipy.org/mailman/listinfo/scipy-user 




More information about the SciPy-user mailing list