Skip to content

Consider handling/setting margin()'s default values based on the theme being used #6115

@arnaudgallou

Description

@arnaudgallou

Currently, the default margin values of margin() are set to 0. This is not ideal because if a user wants to change the margin only on one side of a plot, it forces the user to 1) find out what the default margins of the theme being used are and 2) redefine the default margin values on each other side of a plot.

It would be more convenient if margin() could handle the default values internally (or via a function passed as the default arguments) based on the theme being used so that e.g. one could write:

# ... +
  theme_classic() +
  theme(plot.margin = margin(r = 9.5))

Instead of:

# ... +
  theme_classic() +
  theme(plot.margin = margin(5.5, 9.5, 5.5, 5.5))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions