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

multiple inside guide box with different position #6210

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Yunuuuu
Copy link

@Yunuuuu Yunuuuu commented Nov 28, 2024

Try to fix #5712.

This enables users to set legend.position.inside and legend.justification.inside in theme of guide_legend and guide_colourbar.

Here is an example:

ggplot(mpg, aes(displ, hwy, shape = drv, colour = cty, size = year)) +
    geom_point(aes(alpha = cyl)) +
    guides(
        colour = guide_colourbar(
            position = "inside",
            theme = theme(legend.position.inside = c(1, 0))
        ),
        size = guide_legend(position = "top"),
        alpha = guide_legend(
            position = "inside",
            theme = theme(legend.position.inside = c(0, 1))
        ),
        shape = guide_legend(position = "left")
    )

image

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

Successfully merging this pull request may close these issues.

Multiple legends with position="inside"
1 participant