Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
BUG: matplotlib invert_xaxis crashes when using datetime #3990
Comments
jorisvandenbossche
referenced
this issue
Jun 22, 2013
Merged
BUG: invert_xaxis (negative tot_sec) triggers MilliSecondLocator (#3990) #3991
jorisvandenbossche
added a commit
to jorisvandenbossche/pandas
that referenced
this issue
Jul 10, 2013
|
|
jorisvandenbossche |
6f3cb9e
|
jreback
added a commit
that referenced
this issue
Jul 10, 2013
|
|
jreback |
098de41
|
|
closed via #3991 |
jreback
closed this
Jul 10, 2013
yarikoptic
added a commit
to neurodebian/pandas
that referenced
this issue
Jul 25, 2013
|
|
yarikoptic |
3275685
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jorisvandenbossche commentedJun 22, 2013
From stackoverflow, a question from more than a month ago, but still an issue I think (tested with master).
Basicly, when using
ax.invert_xaxis()with datetime x-values, the following exception is raised:At first it may not seem an error from pandas, as you can trigger it by using pure matplotlib code, but the error comes from pandas\tseries\converter.py. And more, it is by importing pandas that causes working matplotlib code to work no longer:
CAUSE of the bug:
When using
ax.invert_xaxis()the left and right xlim are interchanged. Because of this thedeltain PandasAutoDateLocator will be negative (https://github.com/pydata/pandas/blob/master/pandas/tseries/converter.py#L241).This in turn triggers MilliSecondLocator instead of the normal AutoDateLocator, and causes the error as the datetime range is too big for MilliSecondLocator.
What I don't understand is why this is not happening when using pandas
plotto create the axes object (the workaround I gave at stackoverflow):