Skip to content

Commit 6f3cb9e

Browse files
BUG: invert_xaxis (negative tot_sec) triggers MilliSecondLocator (pandas-dev#3990)
1 parent d5094df commit 6f3cb9e

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

doc/source/release.rst

+2
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ pandas 0.12
324324
(:issue:`4145`, :issue:`4146`)
325325
- Fixed bug in the parsing of microseconds when using the ``format``
326326
argument in ``to_datetime`` (:issue:`4152`)
327+
- Fixed bug in ``PandasAutoDateLocator`` where ``invert_xaxis`` triggered
328+
incorrectly ``MilliSecondLocator`` (:issue:`3990`)
327329

328330
pandas 0.11.0
329331
=============

doc/source/v0.12.0.txt

+2
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ Bug Fixes
461461
iterated over when regex=False (:issue:`4115`)
462462
- Fixed bug in the parsing of microseconds when using the ``format``
463463
argument in ``to_datetime`` (:issue:`4152`)
464+
- Fixed bug in ``PandasAutoDateLocator`` where ``invert_xaxis`` triggered
465+
incorrectly ``MilliSecondLocator`` (:issue:`3990`)
464466

465467
See the :ref:`full release notes
466468
<release>` or issue tracker

pandas/tseries/converter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def get_locator(self, dmin, dmax):
244244
num_sec = (delta.hours * 60.0 + delta.minutes) * 60.0 + delta.seconds
245245
tot_sec = num_days * 86400. + num_sec
246246

247-
if tot_sec < self.minticks:
247+
if abs(tot_sec) < self.minticks:
248248
self._freq = -1
249249
locator = MilliSecondLocator(self.tz)
250250
locator.set_axis(self.axis)

0 commit comments

Comments
 (0)