Skip to content

Feature request: legend.byrow argument added to theme #5541

Closed

Description

@davidhodge931

I think people tend to have a preference for one way or another for all of their plots, so it'd be great if you could add it into your theme once

Activity

  1. changed the title [-]Feature request: legend.byrow argument added to theme[/-] [+]Feature request: `legend.byrow` argument added to `theme`[/+] on Nov 25, 2023
  2. added
    feature
    on Nov 26, 2023
  3. thomasp85 commented on Nov 27, 2023

    @thomasp85
    Member

    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

  4. davidhodge931 commented on Nov 27, 2023

    @davidhodge931
    Author

    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

  5. teunbrand commented on Nov 27, 2023

    @teunbrand
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureguides 📏themes 💃

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions