Re: [Matplotlib-users] Relpos only works once when using FancyArrow for annotation
On Mon, Nov 28, 2011 at 10:49 PM, Jae-Joon Lee lee.j.j...@gmail.com wrote: This is a bug. In the current implementation, annotate has a side-effect that modifies the arrowprops dictionary. For a future reference, this should now be fixed in the v1.1.x branch which also has been merged into the master branch. https://github.com/matplotlib/matplotlib/commit/b3a2ab77c89fdb3ab860edeb1a781b5307347070 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
Re: [Matplotlib-users] Relpos only works once when using FancyArrow for annotation
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
Re: [Matplotlib-users] Relpos only works once when using FancyArrow for annotation
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()) Works for me. Thanks a lot! 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. Thanks for clarifying. Regards, Markus -- 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