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

Pierre GM pgmdevlist at gmail.com
Fri Mar 6 16:11:36 EST 2009


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 at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20090306/55a26486/attachment.html>


More information about the SciPy-User mailing list