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

Don't use offset / scientific notation in numeric legends #3187

Merged
merged 2 commits into from
Dec 18, 2022

Conversation

mwaskom
Copy link
Owner

@mwaskom mwaskom commented Dec 18, 2022

Fixes #3174:

This takes the shortest path solution of simply disabling the offset / scientific notation on a scalar formatter used in the legend. I think it's possible that we'll want to add those as options in Continuous.label in which case we may want to figure out how to show the extra information in a legend context (e.g. as a subtitle or extra row at the bottom of the legend). Punting on that as it seems complicated.

Note that if you do want to format legend entries with scientific notation, you can do Continuous().label(like="{x:.2g}") (not exactly the same thing, but will help when variables have very large values).

@codecov
Copy link

codecov bot commented Dec 18, 2022

Codecov Report

Merging #3187 (9372112) into master (22cdfb0) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3187   +/-   ##
=======================================
  Coverage   98.41%   98.41%           
=======================================
  Files          76       76           
  Lines       24093    24110   +17     
=======================================
+ Hits        23712    23729   +17     
  Misses        381      381           
Impacted Files Coverage Δ
seaborn/_core/scales.py 89.86% <100.00%> (+0.09%) ⬆️
seaborn/utils.py 95.49% <100.00%> (+0.02%) ⬆️
tests/_core/test_plot.py 98.68% <100.00%> (+<0.01%) ⬆️
tests/test_relational.py 99.31% <100.00%> (+<0.01%) ⬆️

@mwaskom mwaskom changed the title Don't show offset / scientific notation in numeric legends Don't use offset / scientific notation in numeric legends Dec 18, 2022
@mwaskom mwaskom merged commit 9bd1665 into master Dec 18, 2022
@mwaskom mwaskom deleted the fix/legend_offset branch December 18, 2022 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong legend values of large ranges
1 participant