Hello, I’m trying to make some text line up with a line from A to B, the problem is that the angle is fixed and not relative to the aspect ratio of the figure. I suppose a way to do it is to get the size of the figure and adjust, but I’m not sure how to do that either. Any help is appreciated.
Here’s a MWE to demonstrate my problem:
using Plots
points = [[0.1, 0.3], [0.3, 0.5]]
midpoint = ((points[1][2] - points[1][1], points[2][2] - points[2][1]) ./ 2) .+ (points[1][1], points[2][1])
p = Plots.plot(xlims = (0,1), ylims = (0,1))
Plots.plot!(points...)
Plots.annotate!(p, midpoint[1], midpoint[2] + 0.1, Plots.text("30", 10, :dark, rotation = 30))
Plots.plot!(size = (500, 500))