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
The placer function computes the angle of the text, so that it follows the isoline, but since it's computed when creating the isoline grob and using the raw x and y values, it doesn't work for arbitrary aspect ratios and / or when changing aspect ratio.
While #28 solves the issue of changing aspect ratio, I think there are other issues with not computing placement at draw time. One direct application of selecting placement at draw time is labelling on the "flattest" segment. I do something like that with metR::label_placement_flattest, which places labels the segment with minimal curvature. I could be wrong (i haven't done the math or anything) but it seems to be that the least "curvy" segment will change depending on aspect ratio.
The placer function computes the angle of the text, so that it follows the isoline, but since it's computed when creating the isoline grob and using the raw x and y values, it doesn't work for arbitrary aspect ratios and / or when changing aspect ratio.
From the example:
I get
Notice that, for example, the 140 text doesn't perfectly follow it's isoline.
Furthermore, the angles remain constant if I change the aspect ratio of the graphics device.
In metR geom_text_contour() evaluates the angle at draw time, so the angle of the text changes as the aspect ratio changes.
The text was updated successfully, but these errors were encountered: