From 7e6b752314e82418c0328cdae7ec0bedf32dbec0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Mon, 22 May 2006 09:32:08 +0000 Subject: [PATCH] fix histograms for negative y-coordinates git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@2768 069f4177-920e-0410-937b-c2a4a81bcd90 --- CHANGES | 1 + pyx/graph/style.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 70edb7ca..c79d71b4 100644 --- a/CHANGES +++ b/CHANGES @@ -95,6 +95,7 @@ TODO: adujstaxis became independend from selectstyle for all styles now) - remove multiple painting of frompath in histogram and barpos styles - fix missing attribute select when using a bar style once only (reported by Alan Isaac) + - fix histograms for negative y-coordinates (reported by Dominic Ford, bug #1492548) - implement a changebar style (TODO: documentation) - graph, axis and style module: - support for mutual linking of axes between graphs diff --git a/pyx/graph/style.py b/pyx/graph/style.py index 30ce3327..69c7a49e 100644 --- a/pyx/graph/style.py +++ b/pyx/graph/style.py @@ -1099,7 +1099,7 @@ class histogram(_style): else: if (privatedata.lastvvalue is not None and (not currentvalid or - privatedata.lastvvalue > vvalue or + abs(privatedata.lastvvalue-privatedata.vfromvalue) > abs(vvalue-privatedata.vfromvalue) or gap)): self.vposline(privatedata, sharedata, graph, privatedata.lastvmax, privatedata.lastvvalue, privatedata.vfromvalue) @@ -1108,7 +1108,7 @@ class histogram(_style): vmin, vvalue) if (currentvalid and (privatedata.lastvvalue is None or - privatedata.lastvvalue < vvalue or + abs(privatedata.lastvvalue-privatedata.vfromvalue) < abs(vvalue-privatedata.vfromvalue) or gap)): self.vmoveto(privatedata, sharedata, graph, vmin, privatedata.vfromvalue) -- 2.11.4.GIT