A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/3490 below:

xaxis limits change when plotting time series of different resolution as secondary_y · Issue #3490 · pandas-dev/pandas · GitHub

In [1]: N = 10000

In [2]: rng = pd.date_range('1/1/2000', periods=N, freq='min')

In [3]: ts = pd.Series(np.random.randn(N), index=rng)

In [4]: ax = ts.plot()

In [5]: ax.get_xlim()
Out[5]: (15778080.0, 15788079.0)

In [6]: ts.resample('D').plot(style='ro', ax=ax)
Out[6]: <matplotlib.axes.AxesSubplot at 0x4482c50>

In [7]: ax.get_xlim()
Out[7]: (15778080.0, 15788079.0)

In [8]: ts.resample('D').plot(style='ro', secondary_y=True, ax=ax)
Out[8]: <matplotlib.axes.AxesSubplot at 0x497e450>

In [9]: ax.get_xlim()
Out[9]: (10957.0, 10963.0)

As the xlim changes, the original data is not visible any more.

Could be related to #2185


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4