Menu

#42 graph.pos method seems broken

closed
nobody
None
5
2012-10-16
2006-05-21
No

The attached code snippet works fine with PyX 0.7.1,
but fails with PyX 0.8.1:


Traceback (most recent call last):
File "pyx_pos.py", line 19, in ?
x,y = g.pos(x=0,y=0)
File
"/usr/local/lib/python2.4/site-packages/pyx/graph/graph.py",
line 169, in pos
return self.xpos + xaxis.convert(x)self.width,
self.ypos + yaxis.convert(y)
self.height
File
"/usr/local/lib/python2.4/site-packages/pyx/graph/axis/axis.py",
line 472, in convert
assert self.canvas is not None, self.errorname
AssertionError: x


I believe the cause of this is that the syntax of the
method "convert" has changed in the file
graph/axis/axis.py, but the pos method in the file
graph/graph.py has not been updated to reflect this change.

Discussion

  • Dominic Ford

    Dominic Ford - 2006-05-21

    Demonstration code snippet

     
  • Andre Wobst

    Andre Wobst - 2006-05-22

    Logged In: YES
    user_id=405853

    Sorry, that's not a bug but a problem due to the anchored axes as introduced
    in PyX 0.8 internally. You need to access the axes by g.axes["x"] and
    g.axes["y"], since only by that they have access to the graphs internal data
    (like the axes ranges ... you can use the original axis instances multiple times
    now). Adjusted the manual in changeset:2769.

     

Log in to post a comment.