Hi,

On Wed, Sep 29, 2010 at 16:00, John Hunter <jdh2358@gmail.com> wrote:
On Wed, Sep 29, 2010 at 8:50 AM, Alexander Dietz
<Alexander.Dietz72@googlemail.com> wrote:

> print ax.transData.transform((10.0, 20.0))
> [ 576.  432.]


Why do you say it's wrong?  Note that in mpl, (0,0) is (bottom left),
not (upper,left).  So this is saying that the yellow dot at 10,20
(data coords) is 576 pixels up from the bottom and 432 pixels over
from the left.

This is not correct, either. Since the total width of the image is 800 pixels and the total height is 600 pixels, I get the following coordinates of the yellow dot:

x-coord: = 432
y-coord = 600-576 = 24

but in fact, the position of the yellow dot is still at (720, 60)!. (And even if you swapped x and y coordinates it will never be correct.).


So anyone another idea how to transform a data-point (10,20) to the image coordinates?


Cheers
  Alex

 

JDH