From 85bf466c5b03622f262e6116b6fb4da8ebcdef1b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Wed, 19 Apr 2006 09:16:58 +0000 Subject: [PATCH] properly handle range rating on inversed axis (reported by Dominic Ford, cf. bug #1461513) git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@2592 069f4177-920e-0410-937b-c2a4a81bcd90 --- CHANGES | 1 + pyx/graph/axis/axis.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 1e7d1b1b..3d464f3e 100644 --- a/CHANGES +++ b/CHANGES @@ -104,6 +104,7 @@ TODO: - axis module: - patch to tickpos and vtickpos (reported by Wojciech Smigaj, cf. patch #1286112) - anchoredpathaxis added (suggested by Wojciech Smigaj) + - properly handle range rating on inversed axis (reported by Dominic Ford, cf. bug #1461513) - painter module: - patch to allow for tickattrs=None (reported by Wojciech Smigaj, cf. patch #1286116) - color module: diff --git a/pyx/graph/axis/axis.py b/pyx/graph/axis/axis.py index 7ffa1449..a622fa00 100644 --- a/pyx/graph/axis/axis.py +++ b/pyx/graph/axis/axis.py @@ -150,9 +150,13 @@ class _regularaxis(_axis): break ticks = tick.mergeticklists(self.manualticks, ticks, mergeequal=0) if ticks: - rate = ( self.rater.rateticks(self, ticks, self.density) + - self.rater.raterange(self.convert(data, ticks[-1]) - - self.convert(data, ticks[0]), 1) ) + rate = self.rater.rateticks(self, ticks, self.density) + if self.reverse: + self.rater.raterange(self.convert(data, ticks[0]) - + self.convert(data, ticks[-1]), 1) + else: + self.rater.raterange(self.convert(data, ticks[-1]) - + self.convert(data, ticks[0]), 1) if bestrate is None or rate < bestrate: bestrate = rate worse = 0 -- 2.11.4.GIT