May a bug of Series.plot in pandas 0.17? · Issue #11529 · pandas-dev/pandas (original) (raw)

The origin post with pictures is on: http://stackoverflow.com/questions/33559772/is-this-a-bug-of-series-plot-in-pandas-0-17

I always use ser.plot(xticks=range(0, len(ser), step), ..) to plot figures with specified xticks. But it doesn't work anymore in pandas 0.17 when the Series with labels. Here are the codes:

In [1]: from numpy import random as rnd In [2]: import pandas as pd In [3]: pd.version Out[3]: '0.17.0' In [4]: %matplotlib inline In [5]: rnd.seed(123) In [6]: ser = pd.Series(rnd.randn(73).cumsum(), index=['P%02d' % i for i in range(73)]) In [7]: ser.plot(figsize=(9, 6), rot=60, title='Figure without xticks') Out[7]: <matplotlib.axes._subplots.AxesSubplot at 0x8370198 In [8]: ser.plot(figsize=(9, 6), xticks=list(range(0, 73, 6)), rot=60, title='Figure with xticks') Out[8]: <matplotlib.axes._subplots.AxesSubplot at 0x83e9940>

image
image

The figure with xticks specified doesn't display xticklabes correctly.