Skip to content

Feature request: Arrangement of guide legend box #6434

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

Open
Yunuuuu opened this issue Apr 17, 2025 · 1 comment
Open

Feature request: Arrangement of guide legend box #6434

Yunuuuu opened this issue Apr 17, 2025 · 1 comment
Labels
feature a feature request or enhancement guides 📏 themes 💃

Comments

@Yunuuuu
Copy link
Contributor

Yunuuuu commented Apr 17, 2025

Currently, ggplot2 only supports controlling the arrangement of keys within a single legend box via the nrow/ncol arguments in guide_legend(). However, there's no built-in way to control the arrangement of multiple legend boxes themselves (e.g., laying the legen box out in rows or columns when multiple legends are present).

This is the issue in stackoverflow
multiple legends arrangement, to create legends like this:

Image

Would it be feasible to add support for arranging multiple legend boxes, through a new theme() option?

@teunbrand
Copy link
Collaborator

teunbrand commented Apr 17, 2025

I can see why this is useful, but I imagine that if we introduce this then the next ask is going to be to do this for every position independently, so we'd have to introduce 5 new theme options for every position + a 6th one as a parent. The subsequent ask would then perhaps be how we could use arbitrary layouts (à la patchwork::plot_layout(design)).

The theme options as we have them currently are already pretty opaque as to what option pertains to what element of the guide(box) already. I'm not opposed to this, but perhaps we should rethink more thoroughly how users should interact with guide boxes/legends that doesn't perplex as much.

@teunbrand teunbrand added guides 📏 feature a feature request or enhancement themes 💃 and removed guides 📏 labels Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement guides 📏 themes 💃
Projects
None yet
Development

No branches or pull requests

2 participants