When setting a dpi value and using unit = 'points' in the AngleAnnotation example class, it does not scale the Arc width and height correctly. I will use the example from the link above to show the problem:
Code for reproduction
fig, ax=plt.subplots(dpi=300)
fig.canvas.draw() # Need to draw the figure to define rendererax.set_title("AngleLabel example")
# Plot two crossing lines and label each angle between them with the above# ``AngleAnnotation`` tool.center= (4.5, 650)
p1= [(2.5, 710), (6.0, 605)]
p2= [(3.0, 275), (5.5, 900)]
line1, =ax.plot(*zip(*p1))
line2, =ax.plot(*zip(*p2))
point, =ax.plot(*center, marker="o")
am1=AngleAnnotation(center, p1[1], p2[1], ax=ax, size=75, text=r"$\alpha$")
am2=AngleAnnotation(center, p2[1], p1[0], ax=ax, size=35, text=r"$\beta$")
am3=AngleAnnotation(center, p1[0], p2[0], ax=ax, size=75, text=r"$\gamma$")
am4=AngleAnnotation(center, p2[0], p1[1], ax=ax, size=35, text=r"$\theta$")
# Showcase some styling options for the angle arc, as well as the text.p= [(6.0, 400), (5.3, 410), (5.6, 300)]
ax.plot(*zip(*p))
am5=AngleAnnotation(p[1], p[0], p[2], ax=ax, size=40, text=r"$\Phi$",
linestyle="--", color="gray", textposition="outside",
text_kw=dict(fontsize=16, color="gray"))
plt.show()
Actual outcome
Expected outcome
The expected outcome can be produced when changing size to get_size() in the Arc initialisation.
changed the title [-][Bug]: Example for "Scale invariant angle label" does not scale the arc correctly[/-][+][Doc]: Example for "Scale invariant angle label" does not scale the arc correctly[/+]on Feb 4, 2022
I agree that they have not quite threaded the dpi to physical units dance properly, OTOH, I'm not convinced the annotations are meant to go not he inside of the Arcs either, and in my machine they do not (hiDPI). Someone will have to go in and fix the transforms here...
I want to make sure I am clear on the actual issue here, as I'm reviewing #23027. The angle markings need to be scaled to take DPI into account so that the labels remain in the correct positions, correct?
Here is an image that demonstrates the issue on different DPIs:
The labels should always be inside the angle markings, but with different DPI settings, they are not.
Activity
jklymak commented on Feb 4, 2022
I agree that they have not quite threaded the dpi to physical units dance properly, OTOH, I'm not convinced the annotations are meant to go not he inside of the Arcs either, and in my machine they do not (hiDPI). Someone will have to go in and fix the transforms here...
QuLogic commented on Feb 5, 2022
That depends on the textposition=['inside'|'outside'] parameter; it defaults to inside, I believe.
kkoutris commented on May 1, 2022
I would like to work on this issue. Can someone guide me (where to look at) except angle_annotation.py ??
andrew-fennell commented on May 10, 2022
I want to make sure I am clear on the actual issue here, as I'm reviewing #23027. The angle markings need to be scaled to take DPI into account so that the labels remain in the correct positions, correct?
Here is an image that demonstrates the issue on different DPIs:

The labels should always be inside the angle markings, but with different DPI settings, they are not.