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

Add Plot.label method #2902

Merged
merged 4 commits into from
Jul 14, 2022
Merged

Add Plot.label method #2902

merged 4 commits into from
Jul 14, 2022

Conversation

mwaskom
Copy link
Owner

@mwaskom mwaskom commented Jul 13, 2022

Another specific configuration method. Like Plot.limit, also subject to changes before release on the name (and on whether it should be a distinct function) but status quo bias is strong.

Accepts a string, a function, or None:

(
    so.Plot(tips, "day", "total_bill", color="sex")
    .add(so.Bar(), so.Agg(), so.Dodge())
    .label(x=str.capitalize, y="Total bill ($)", color=None)
)

image

This API will entail a separation between the text of the labels and any other configuration of them, and I am not sure where other configuration should live as of the moment.

@codecov
Copy link

codecov bot commented Jul 13, 2022

Codecov Report

Merging #2902 (932b8c4) into master (05066e0) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2902   +/-   ##
=======================================
  Coverage   98.20%   98.20%           
=======================================
  Files          69       69           
  Lines       22625    22664   +39     
=======================================
+ Hits        22219    22258   +39     
  Misses        406      406           
Impacted Files Coverage Δ
seaborn/_core/plot.py 94.93% <100.00%> (+0.13%) ⬆️
tests/_core/test_plot.py 98.45% <100.00%> (+0.02%) ⬆️

@mwaskom mwaskom merged commit 022e4bd into master Jul 14, 2022
@mwaskom mwaskom deleted the plot/label branch July 14, 2022 00:26
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.

1 participant