Annotations - negative points and pixels don't wrap

Hi. The docs for Annotation [1] say that negative coordinates given for [ figure | axes ] [ points | pixels ] xycoords are to be interpreted relative to the top-right corner, but I found that they act relative to the bottom-left corner as for positive coordinates. This can be seen in the attached script and in the annotation_demo.py example [2], where the string “bottom right (points)” bleeds off the left edge of the figure.

[1] http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.text.Annotation

[2] http://matplotlib.sourceforge.net/examples/pylab_examples/annotation_demo.html

corners.py (258 Bytes)

corners.png

I believe this was recently introduced when I refactored the annotation code.
Attached is a preliminary fix. So, please test it if you can.
Since the change during the refactoring was rather significant, I'm
not 100% sure if this will restore the old behavior without affecting
the new functionality. The examples I tried (including yours) seem to
work fine. I'll test this myself a few more days, and commit to the
svn.

I personally think it is better to use "offset points" for these cases
which makes the internal logic much simpler.

Regards,

-JJ

fix_annotation.diff (518 Bytes)

···

On Sat, Dec 11, 2010 at 6:07 AM, Stan West <stan.west@...595...> wrote:

Hi. The docs for Annotation [1] say that negative coordinates given for [
figure | axes ] [ points | pixels ] xycoords are to be interpreted relative
to the top-right corner, but I found that they act relative to the
bottom-left corner as for positive coordinates. This can be seen in the
attached script and in the annotation_demo.py example [2], where the string
"bottom right (points)" bleeds off the left edge of the figure.

[1]
http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.text.Annotation

[2]
http://matplotlib.sourceforge.net/examples/pylab_examples/annotation_demo.html

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

From: Jae-Joon Lee [mailto:lee.j.joon@…149…]
Sent: Monday, December 13, 2010 05:24

Attached is a preliminary fix. So, please test it if you can.

Thank you. Your fix seems to do the trick.

I personally think it is better to use "offset points" for these cases
which makes the internal logic much simpler.

I can see that, and that's what I was using as a work-around.

The patch is applied to the maintenance branch (r8846) and the trunk (r8847).

-JJ

···

On Wed, Dec 22, 2010 at 11:49 PM, Stan West <stan.west@...595...> wrote:

From: Jae-Joon Lee [mailto:lee.j.joon@…149…]
Sent: Monday, December 13, 2010 05:24

Attached is a preliminary fix. So, please test it if you can.

Thank you. Your fix seems to do the trick.

I personally think it is better to use "offset points" for these cases
which makes the internal logic much simpler.

I can see that, and that's what I was using as a work-around.