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
Legend mis-alignement for parsing greek letters using scale::parse_format #4814
In the first figure, the right-hand side legend is correctly aligned with the regular ggplot code. However, the greek characters were mis-aligned when labels=parse_format() is used to parse "microgram" in the second figure, as indicated by the gap (white space) next to the legend "1 ug". The erratic alignment behavior sounds like a bug to me.
While poorly documented, the default justification for expressions in labels has always been right-aligned. This can of course be overwritten in the guide. I can't comment on the reason for this decision as it predates my time with ggplot2 (meaning it is ancient 🙂). This also means that it is probably too late to change as others may likely rely on the default behaviour...
Activity
thomasp85 commentedon May 12, 2022
While poorly documented, the default justification for expressions in labels has always been right-aligned. This can of course be overwritten in the guide. I can't comment on the reason for this decision as it predates my time with ggplot2 (meaning it is ancient 🙂). This also means that it is probably too late to change as others may likely rely on the default behaviour...
Sibojang9 commentedon May 17, 2022
This is a typical sunk cost fallacy. It will take more toll to fix in future.
thomasp85 commentedon May 17, 2022
Well, it's not really a bug so there is nothing to fix later. It was a poorly documented behaviour that is now properly documented.
Sibojang9 commentedon May 17, 2022
Do you have the link to the docu?
thomasp85 commentedon May 17, 2022
ggplot2/R/guide-legend.r
Lines 34 to 36 in eb0010e
Sibojang9 commentedon May 17, 2022
Thank you so much for sharing.