plot_date() runtime error

Hi,

I have been trying to leverage plot_date() to generate time trends. I seem to run into the following runtime error and don’t have much insight as to why this is happening. Specifically, I don’t quite see why the function is attempting to set the lower bound to 0001-01-01 UTC when my x-axis starts only from day number 729390.

I am using Python 2.4 and Matplotlib 1.0.1

In [131]: date_num = date2num(dates)

In [132]: date_num

Out[132]:

array([ 729390., 729391., 729392., 729393., 729394., 729395.,

729396., 729397., 729398., 729399.])

In [133]: plot_date(date_num,range(10))

RuntimeError: RRuleLocator estimated to generate 2012 ticks from 0001-01-01 00:00:00+00:00 to 2012-02-04 17:46:21.028099+00:00: exceeds Locator.MAXTICKS * 2 (2000)

Any help will be much appreciated.

Thanks,
Shankar

Hi Shankar,

Shankararaman Ramakrishnan, on 2012-01-26 18:24, wrote:

I have been trying to leverage plot_date() to generate time trends. I
seem to run into the following runtime error and don't have much
insight as to why this is happening. Specifically, I don't quite see why
the function is attempting to set the lower bound to 0001-01-01 UTC when
my x-axis starts only from day number 729390.

I suspect this may be the case because you've already plotted
something on this axis that resolves to this early date. For
example, I can reproduce an error similar to yours by first doing
plot(1,0) before the plot_date call.

Can you try to create a new figure just before the call to plot_date?

best,

···

--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7