You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using pandas.TimeSeries.plot() causes a shift in the plotted timeseries when plotting two different TimeSeries objects on the same axis. When plotting in subplots or plotting using pylab/matplotlib directly it behaves as expected. Issue remains if objects are DataFrames instead of Series.
pandas plotting machinery tries to match frequencies (and convert to PeriodIndex) if possible and looks like this is a bug caused by using PeriodIndex.asfreq default behavior. We'll put in a fix.
Thanks for the bug report.
using pandas.TimeSeries.plot() causes a shift in the plotted timeseries when plotting two different TimeSeries objects on the same axis. When plotting in subplots or plotting using pylab/matplotlib directly it behaves as expected. Issue remains if objects are DataFrames instead of Series.
Version 0.9.1
Simple code to reproduce:
import pandas as pd
import pylab as pl
ts_ind=pd.date_range('2012-01-01 13:00', '2012-01-02', freq='H')
ts_data=pl.random(12)
hourly timeseries
ts=pd.TimeSeries(ts_data, index=ts_ind)
minute frequency timeseries
ts2=ts.asfreq('T').interpolate()
using TimeSeries.plot()
pl.figure()
ts.plot()
ts2.plot(style='r')
using pylab.plot()
pl.figure()
pl.plot(ts.index, ts.values)
pl.plot(ts2.index, ts2.values, '-r')
using TimeSeries.plot() on different axes
pl.figure()
pl.subplot(211)
ts.plot()
pl.subplot(212)
ts2.plot(style='r')
the two timeseries objects are correct, problem lies with the plotting:
ts.index[ts==ts.max()]
ts2.index[ts2==ts2.max()]
The text was updated successfully, but these errors were encountered: