From 6f3cb9ee9ccbc4946c0096d15114c02a9550b721 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Wed, 10 Jul 2013 20:20:28 +0200 Subject: [PATCH] BUG: invert_xaxis (negative tot_sec) triggers MilliSecondLocator (#3990) --- doc/source/release.rst | 2 ++ doc/source/v0.12.0.txt | 2 ++ pandas/tseries/converter.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/source/release.rst b/doc/source/release.rst index a9e88f1341992..3799b0a8a24d6 100644 --- a/doc/source/release.rst +++ b/doc/source/release.rst @@ -324,6 +324,8 @@ pandas 0.12 (:issue:`4145`, :issue:`4146`) - Fixed bug in the parsing of microseconds when using the ``format`` argument in ``to_datetime`` (:issue:`4152`) + - Fixed bug in ``PandasAutoDateLocator`` where ``invert_xaxis`` triggered + incorrectly ``MilliSecondLocator`` (:issue:`3990`) pandas 0.11.0 ============= diff --git a/doc/source/v0.12.0.txt b/doc/source/v0.12.0.txt index b4be283228455..33228d99dd097 100644 --- a/doc/source/v0.12.0.txt +++ b/doc/source/v0.12.0.txt @@ -461,6 +461,8 @@ Bug Fixes iterated over when regex=False (:issue:`4115`) - Fixed bug in the parsing of microseconds when using the ``format`` argument in ``to_datetime`` (:issue:`4152`) + - Fixed bug in ``PandasAutoDateLocator`` where ``invert_xaxis`` triggered + incorrectly ``MilliSecondLocator`` (:issue:`3990`) See the :ref:`full release notes ` or issue tracker diff --git a/pandas/tseries/converter.py b/pandas/tseries/converter.py index dc0df89d1ef9c..d0ec942cec307 100644 --- a/pandas/tseries/converter.py +++ b/pandas/tseries/converter.py @@ -244,7 +244,7 @@ def get_locator(self, dmin, dmax): num_sec = (delta.hours * 60.0 + delta.minutes) * 60.0 + delta.seconds tot_sec = num_days * 86400. + num_sec - if tot_sec < self.minticks: + if abs(tot_sec) < self.minticks: self._freq = -1 locator = MilliSecondLocator(self.tz) locator.set_axis(self.axis)