From 0f7e1342e3bc020ce266718d206c11b020b4c2b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Wed, 26 Apr 2006 12:49:08 +0000 Subject: [PATCH] disable distancerating by labels being None in the axiscanvas git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@2613 069f4177-920e-0410-937b-c2a4a81bcd90 --- pyx/graph/axis/painter.py | 4 ++++ pyx/graph/axis/rater.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/pyx/graph/axis/painter.py b/pyx/graph/axis/painter.py index 93907997..51ec66e0 100644 --- a/pyx/graph/axis/painter.py +++ b/pyx/graph/axis/painter.py @@ -236,6 +236,10 @@ class regular(_title): extent_pt = t.temp_labelbox.extent_pt(t.temp_dx, t.temp_dy) + labeldist_pt if extent_pt > canvas.extent_pt: canvas.extent_pt = extent_pt + + if self.labelattrs is None: + canvas.labels = None + if self.basepathattrs is not None: canvas.stroke(axispos.vbasepath(), self.defaultbasepathattrs + self.basepathattrs) diff --git a/pyx/graph/axis/rater.py b/pyx/graph/axis/rater.py index 4a46ea4a..e266277c 100644 --- a/pyx/graph/axis/rater.py +++ b/pyx/graph/axis/rater.py @@ -206,6 +206,8 @@ class rater: access to the labels whose distances have to be taken into account - the density is used within the distancerate instance""" + if axiscanvas.labels is None: # to disable any layout rating + return 0 if len(axiscanvas.labels) > 1: try: distances = [axiscanvas.labels[i].boxdistance_pt(axiscanvas.labels[i+1]) -- 2.11.4.GIT