[SciPy-user] scikit.timeseries plotting bugs?

Pierre GM pgmdevlist@gmail....
Fri Dec 5 11:34:29 CST 2008

On Dec 5, 2008, at 11:11 AM, Dharhas Pothina wrote:
> @ Matt & Pierre :
> So if I understand correctly if I plot multiple time series with  
> different frequencies it should use the .asfreq method to transform  
> the other series to the first series frequency.

That's the generic idea. Or, you plot a first series, then plot the  
others: the others will be modified w/ .asfreq

> I want to make sure I understand .asfreq correctly.
> 1) If .asfreq is converting to a higher frequency the data stays the  
> same and extra dates are added with no data/masked values

Well, not exactly: in that case, the dates are internally transformed  
to the new frequency, there's no addition of dates

> 2) If converting to a lower frequency multiple data points end up on  
> the same date


> Implications of this are that for what I am trying to do I need to  
> put the highest frequency plot first.


>> That's actually not the way it was designed. In normal procedure, you
>> create a tsplot with a time_series attached. The plot gets its
>> frequency from this series, and all the series that are plotted are
>> transformed to the plot frequency uisng their .asfreq method: in  
>> other
>> terms, you don;t change the data, just the representation of the
>> dates. It's quite convenient and I don't see why we should raise an
>> exception. Issue a warning, perhaps, but let it work. <note_to_self>
>> need to document that </note_to_self>
> Another question. How do I set the x limits. In my plot the two  
> timeseries go from 12/15/05 - 04/01/07 & from 01/01/06 - 12/31/06.  
> If I do not specify the x limits the x ticks and labels look very  
> nice and well spaced. However, if I try to limit the plot to a date  
> range by using fsp.set_xlim(startdate,enddate) where startdate and  
> enddate are datetimes, it works but the major/minor ticks don't look  
> correct and labeling looks bad.

Don't use set_xlim on the plot, unless you understand how it works.  
Integers are associated with each date of a time_series, depending on  
its frequency. You need to set the xlims to integers that are  
compatible wth your series.
The easiest by far is to use the `set_datelimits` method of your plot.

More information about the SciPy-user mailing list