You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Possible bug on arrows in annotation #21733
Arrow starting point should be consistent, or at least adjustable; relpos is not available as a FancyArrowPatch key, so if I add it, I get AttributeError: 'FancyArrowPatch' object has no property 'relpos'
Eventually, I gave up trying to do what I wanted (just have arrows emanating from the center of the block by trying to use relpos as I mentioned in #21732 ) and took an approach in StackOverflow and just created separate annotations for the arrows and for the text.
what I wanted (just have arrows emanating from the center of the block by trying to use relpos as I mentioned in #21732 )
@jason-sachs that's possible if you specify an arrowstyle, e.g. arrowprops=dict(arrowstyle='-|>', facecolor='black'). You can also use relpos here if you want.
There are two different draw routines with different behavior and I hope #21743 makes this more clear.
Activity
timhoffm commentedon Nov 24, 2021
The question is: On which angles do we want to change the anchor point?
Currently the rules seem to be:
anntzer commentedon Nov 24, 2021
The relevant logic is at
matplotlib/lib/matplotlib/text.py
Lines 1932 to 1937 in 73304d2
jason-sachs commentedon Nov 24, 2021
I don't mind the existing implementation if it's documented -- it was a bit of a surprise to me.
...or allow the user to override this somehow.
jason-sachs commentedon Nov 24, 2021
Eventually, I gave up trying to do what I wanted (just have arrows emanating from the center of the block by trying to use
relposas I mentioned in #21732 ) and took an approach in StackOverflow and just created separate annotations for the arrows and for the text.timhoffm commentedon Nov 24, 2021
@jason-sachs that's possible if you specify an arrowstyle, e.g.
arrowprops=dict(arrowstyle='-|>', facecolor='black'). You can also userelposhere if you want.There are two different draw routines with different behavior and I hope #21743 makes this more clear.
jason-sachs commentedon Nov 29, 2021
Yeah, I tried that, but using
arrowstyledoesn't let me get the type of arrowhead I want.timhoffm commentedon Nov 29, 2021
Which type of head would you want?