Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation: values list for legend.box.just appears incomplete #4196

Open
twest820 opened this issue Sep 9, 2020 · 1 comment · May be fixed by #5871
Open

documentation: values list for legend.box.just appears incomplete #4196

twest820 opened this issue Sep 9, 2020 · 1 comment · May be fixed by #5871

Comments

@twest820
Copy link

twest820 commented Sep 9, 2020

The current documentation for theme() states

legend.box.just justification of each legend within the overall bounding box, when there are multiple legends ("top", "bottom", "left", or "right")

I happened to need theme(legend.box.just = "center") so I tried it anyway and found it behaved as expected when centering two legends (an alpha legend and a merged color plus linetype legend) within a bottom legend box.

So life is good. But it would be useful to know if this just signals the documentation is a bit out of date or if I'm relying on a behavior that's formally unsupported.

Version; ggplot 3.3.2

@clauswilke
Copy link
Member

The value of legend.box.just is converted into numerical justification parameters using the function grid::valid.just():

just <- valid.just(theme$legend.box.just)

So you can set legend.box.just to whatever values valid.just() understands. Unfortunately that function isn't well documented either. The documentation literally says e.g., "left" becomes 0, "right" becomes 1, etc, ....

The value "center" is supported, though, and the theme documentation should say so.

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

Successfully merging a pull request may close this issue.

3 participants