-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Description
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()]