Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Just looking at the <a href="http://matplotlib.org/users/annotations_intro.html" rel="nofollow">http://matplotlib.org/users/annotations_intro.html</a> page. It seems that the text can be placed independently of the arrow if you know the coordinates. Add this before the draw() command:</p> <pre><code>ant2 = ax.annotate('this is\nthe text\ni want\nto add', xy=(0.1, 0.8), xytext=(0.1, 0.8), horizontalalignment='left', verticalalignment='top') </code></pre> <p>In terms of a generalized solution, it would be as complex as the original annotate because there are quite a few different kinds of things that are created depending on the parameters given to annotate. For instance if the arrowstyle is not specified then a YAArow patch instance is created. You can call YAArow's get_path() but a path is of limited usefulness since it's more or less just a collection of points. You would need to write a "find_middle_of_path()" which would need to take into account that paths don't necessarily need to be contiguous, and that sometimes all of the attributes of the path are not filled out by methods that use it, etc. An example of when an arrow path would be non-contiguous would be when the middle of the arrow path is clipped by the edge of the figure.</p> <p>If arrowstyle is specified then a FancyArrowPatch instance is created. If a FancyArrowPatch is created, you can call get_path_in_displaycoord() to get the path with the same caveat as for YAArow patch path.</p> <p>IMHO you are better off creating a number of rather simple routines that call annotate two times, one for the arrow and one for the text that correspond with the probably limited ways that you really want to use annotate.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload