On Mon, Nov 28, 2011 at 9:39 PM, Markus Baden <markus.ba...@gmail.com> wrote:
> anno_args = {
>     'annotation_clip': False,
>     'arrowprops': dict(arrowstyle='-', relpos=(0, 1)),
>     }
> plt.annotate('Good relpos', (3, 3), xytext = (3, 2), **anno_args)
> plt.annotate('Bad relpos', (6, 6), xytext = (6, 5), **anno_args)

This is a bug. In the current implementation, "annotate" has a
side-effect that modifies the arrowprops dictionary.
As a workaround, you may do,

arrowprops = dict(arrowstyle='-', relpos=(0, 1))
plt.annotate('Good relpos', (3, 3), xytext = (3, 2),
             annotation_clip=False, arrowprops=arrowprops.copy())


> plt.annotate('No ha/va', (5, 5), xytext = (5, 4),
> arrowprops=dict(arrowstyle='-'),
>              ha='left', va='top')
>

ha and va controls the location of the text relative to the xytext,
and I believe it does work as expected. It has nothing to do with the
starting point of the arrow, which should be controlled by the relpos
parameter.

Regards,

-JJ

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to