0

When I execute the following statement:

DataFrame(randn(3,1),index=[date(2012,10,1),date(2012,9,1),date(2012,8,1)],columns=['test']).plot() 

I get the following exception:

File "/usr/local/lib/python2.7/dist-packages/pandas-0.10.0-py2.7-linux-x86_64.egg/pandas/tseries/converter.py", line 317, in call (estimate, dmin, dmax, self.MAXTICKS * 2)) RuntimeError: MillisecondLocator estimated to generate 5270400 ticks from 2012-08-01 00:00:00+00:00 to 2012-10-01 00:00:00+00:00: exceeds Locator.MAXTICKS* 2 (2000)

Any workaround available for this bug ?

ronnydw
  • 923
  • 16
  • 24

1 Answers1

0

One workaround is to sort before plotting:

df.sort().plot()

It looks like a bug, so I posted it on github!

Note: this seems to plot ticks better if you use datetime rather than date:

df1 = DataFrame(randn(3,1), index=[datetime(2012,10,1), datetime(2012,9,1), datetime(2012,8,1)], columns=['test'])
Andy Hayden
  • 359,921
  • 101
  • 625
  • 535