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

Legend overflow #1235

Open
Zaf4 opened this issue Nov 11, 2024 · 2 comments
Open

Legend overflow #1235

Zaf4 opened this issue Nov 11, 2024 · 2 comments

Comments

@Zaf4
Copy link

Zaf4 commented Nov 11, 2024

Hi,

Similar to #846 the legend overflow exists, this time more vertically.

The legend is fine with when ggsize(800,600) but when I add ggsize(600,400), this happens...

scatter

to highlight the overflow with the rectangles
+ theme(plot_background=element_rect(color="red", size=4), legend_background=element_rect(color="blue", size=4))
scatter_rect

panel shrinking and allowing multi-column legend column automatically, if legend(s) will overflow, could be a good fix.

@alshan
Copy link
Collaborator

alshan commented Nov 13, 2024

Do I understand correctly that you know how to make multi-column legend manually (see example in guide_legend()) but wish the legend to "wrap" automatically?
Also note that in recent v 4.5.1. you can make legend more compact by reducing its key height/key spacing: https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/examples/cookbook/legend_theme.ipynb

@Zaf4
Copy link
Author

Zaf4 commented Nov 19, 2024

Do I understand correctly that you know how to make multi-column legend manually (see example in guide_legend()) but wish the legend to "wrap" automatically?

Exactly!

Also note that in recent v 4.5.1. you can make legend more compact by reducing its key height/key spacing: https://nbviewer.org/github/JetBrains/lets-plot-docs/blob/master/source/examples/cookbook/legend_theme.ipynb

This is a very good feature as well, thanks for adding this. But I think legend overflowing kind of breaks the plot.

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

No branches or pull requests

2 participants