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
Feature request: legend.byrow argument added to theme #5541
changed the title [-]Feature request: legend.byrow argument added to theme[/-][+]Feature request: `legend.byrow` argument added to `theme`[/+]on Nov 25, 2023
I'd tend to be against it... Figuring out the right things to include as theme settings are a bit hard but at the moment at least I think we should try to avoid settings that are specific only to a single type of legend...
But if you always want your legends arranged by row, it is super useful if you can put this in your custom theme - and then it always happens, and you don't have to think about anymore :) Otherwise you have to always add a guide for every plot you produce..
Conceptually, the colourbar and coloursteps are only 1 thing, so whether they are arranged by row or not, it should still look the same - so legend.byrow would still make sense conceptually for legends, colourbars and colourseps etc
Arguably, the legend is 'just one guide', but also it is the one guide that applies to all (non-position) aesthetics so in practise it is a pretty common guide. On the other hand, where does the argument creep stop? Should we also add reverse to the theme? nrow? override.aes?
Personally, I don't mind putting some guide_legend() arguments in the theme, if we can stop keeping track of them separately in guide_legend(). It is a pet peeve of mine that they can be declared in either the theme and the guide and the consolidation of the two definitions is very fussy. For example, the logic of the legend label's horizontal justification is:
'we'll just ignore the theme's legend.text.hjust setting if inherited, but not if it is declared directly, but do not ignore the guide's label.hjust setting, which is allowed to override whatever the element given to label.theme has as property. we use a right-aligned default for expressions, and for plain labels we'll center-align them, except when label.position = "left"/"right" because then we use that as alignment'
I don't like raising a similar kerfuffle for other theme/legend options.
Activity
[-]Feature request: legend.byrow argument added to theme[/-][+]Feature request: `legend.byrow` argument added to `theme`[/+]thomasp85 commentedon Nov 27, 2023
I'd tend to be against it... Figuring out the right things to include as theme settings are a bit hard but at the moment at least I think we should try to avoid settings that are specific only to a single type of legend...
I concede this is a pretty vast grey area
davidhodge931 commentedon Nov 27, 2023
But if you always want your legends arranged by row, it is super useful if you can put this in your custom theme - and then it always happens, and you don't have to think about anymore :) Otherwise you have to always add a guide for every plot you produce..
Conceptually, the colourbar and coloursteps are only 1 thing, so whether they are arranged by row or not, it should still look the same - so legend.byrow would still make sense conceptually for legends, colourbars and colourseps etc
teunbrand commentedon Nov 27, 2023
Arguably, the legend is 'just one guide', but also it is the one guide that applies to all (non-position) aesthetics so in practise it is a pretty common guide. On the other hand, where does the argument creep stop? Should we also add
reverseto the theme?nrow?override.aes?Personally, I don't mind putting some
guide_legend()arguments in the theme, if we can stop keeping track of them separately inguide_legend(). It is a pet peeve of mine that they can be declared in either the theme and the guide and the consolidation of the two definitions is very fussy. For example, the logic of the legend label's horizontal justification is:I don't like raising a similar kerfuffle for other theme/legend options.