problem with annotate

Hello list,

I'm encountering a problem with annotate using the latest svn and GTKAgg-
backend.

I plot several annotate-arrows in my script, but some of them aren't saved to
the eps/pdf - file. More precisely the lower left arrow in the attached
example, who touches the lower (negative) boundary of the plot arrea shows up
in the matplotlib figure and the png-picture, but not in the pdf / eps output.

It seems to be important that in my case the lower limit of the y-axis is
negative.

I found two solutions to this problems, which are the middle and right of the
lower arrows, but I don't understand why this is needed. The middle arrow does
not touch the lower boundary and the right arrow has an inverted direction and
inverted arrowstyle.

Is this a bug or did I miss something?

Kind regards and thanks in advance for any hints.
Matthias

annotate_error.eps (11.2 KB)

annotate_error.pdf (5.73 KB)

annotate_error.png

annotate_error.py (843 Bytes)

By default, when the xy coordinate of the annotate is given in the
data coordinate, it draws the arrow only if the xy point is inside the
axes bbox. And, when the xy point is at the boundary of the axes bbox,
the inside-test results seems to depend on the backend. So, some
backends draws the arrow but others do not.

I'll try to improve the situation but I'm not quite sure how.

Meanwhile, you can turn off the inside-test by setting annotate_clip=False.

ax.annotate("", xy = (0.1, -0.5), xytext = (0.1, -0.2),
            arrowprops = dict(arrowstyle = "->"), annotation_clip=False)

IHTH,

Regards,

-JJ

ยทยทยท

On Fri, Jun 4, 2010 at 10:59 AM, Matthias Michler <MatthiasMichler@...361...> wrote:

Hello list,

I'm encountering a problem with annotate using the latest svn and GTKAgg-
backend.

I plot several annotate-arrows in my script, but some of them aren't saved to
the eps/pdf - file. More precisely the lower left arrow in the attached
example, who touches the lower (negative) boundary of the plot arrea shows up
in the matplotlib figure and the png-picture, but not in the pdf / eps output.

It seems to be important that in my case the lower limit of the y-axis is
negative.

I found two solutions to this problems, which are the middle and right of the
lower arrows, but I don't understand why this is needed. The middle arrow does
not touch the lower boundary and the right arrow has an inverted direction and
inverted arrowstyle.

Is this a bug or did I miss something?

Kind regards and thanks in advance for any hints.
Matthias

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options