Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#52 "namedirection" for graph.axis.painter.bar not working

closed
nobody
None
5
2012-10-16
2008-07-25
rhunger
No

I tried to use "namedirection" for a bar plot to rotate
x-axis labels. This resulted in a traceback (see doc string in attached file).

The attached file contains an example program which triggers the traceback.

The following patch works for me:

"""
--- painter.py.orig 2008-07-25 18:43:19.000000000 +0200
+++ painter.py.new 2008-07-25 18:03:59.000000000 +0200
@@ -308,7 +308,7 @@
for (v, x, y, dx, dy), name in zip(namepos, data.names):
nameattrs = self.defaultnameattrs + self.nameattrs
if self.namedirection is not None:
- nameattrs.append(self.namedirection.trafo(tick.temp_dx, tick.temp_dy))
+ nameattrs.append(self.namedirection.trafo(dx, dy))
nameboxes.append(canvas.texrunner.text_pt(x, y, str(name), nameattrs))
labeldist_pt = canvas.extent_pt + unit.topt(self.namedist)
if len(namepos) > 1:
"""

Discussion

  • rhunger
    rhunger
    2008-07-25

    triggers bug, doc string contains a patch

     
    Attachments
  • Andre Wobst
    Andre Wobst
    2011-05-15

    thanks a lot for the detailed report and suggested fix. committed in changeset 3096.