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 title in horizontal mode is misaligned and ambiguously sized #5595

Closed
nicolaskruchten opened this issue Apr 20, 2021 · 5 comments · Fixed by #5611
Closed

Legend title in horizontal mode is misaligned and ambiguously sized #5595

nicolaskruchten opened this issue Apr 20, 2021 · 5 comments · Fixed by #5611
Labels
bug something broken

Comments

@nicolaskruchten
Copy link
Contributor

nicolaskruchten commented Apr 20, 2021

image

Maybe we need new values for legend.title.side like "middle left" and "top center"?

We also have a typography-hierarchy problem where the legend title by default is the same size as the legend items, and is smaller than e.g. the axis title size. So maybe we need to make the legend title (and colorbar title!) size the same as xaxis.title.size as well to avoid ambiguity. And/or implement #4646 and just make all the titles bold, like the way Vega does it.

@nicolaskruchten
Copy link
Contributor Author

To be honest, even just setting the default legend/colorbar title font size to 14 improves things a lot IMO:

image

@archmoj archmoj added Major change bug something broken feature something new labels Apr 22, 2021
@nicolaskruchten nicolaskruchten changed the title Legend title in horizontal mode is misaligned Legend title in horizontal mode is misaligned and ambiguously sized Apr 23, 2021
@archmoj archmoj removed the feature something new label Apr 26, 2021
@nicolaskruchten
Copy link
Contributor Author

@alexcjohnson we played with various permutations of increasing the font size as in this PR and bolding it and bolding with no change to font size or a smaller change to font size and all things considered, I still favour bumping the font size defaults for legend and colorbar titles (all orientations) to exactly match the logic we have for axis titles.

@nicolaskruchten
Copy link
Contributor Author

Here are three variants we looked at. I favour "big"

newplot (1)
newplot (2)
newplot (3)

@alexcjohnson
Copy link
Collaborator

OK, "big" is fine. I still somewhat prefer "small and bold" I think, as a way to better disambiguate the title from the trace names, but that would be a pretty big visual change to push on people as a new default. The vertical misalignment I still think should be treated simply as a bug, having font size "fix" it seems awfully fragile - does the "fix" still work if you make layout.font.size bigger or smaller?

@nicolaskruchten
Copy link
Contributor Author

OK re "big" for now.

does the "fix" still work if you make layout.font.size bigger or smaller?

First thing I checked, and no. I think we should merge a version of #5611 that implements the size changes, and then actually tackle this alignment problem for real. We do need to have a conversation about what we want this alignment to be, though, and it's pretty tricky to spec out given various permutations of "legend title could be multiple lines", "there could be multiple rows of legend items" and "trace names could be multiple lines". Input needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
3 participants