Skip to content

Add Plot.label method#2902

Merged
mwaskom merged 4 commits into
masterfrom
plot/label
Jul 14, 2022
Merged

Add Plot.label method#2902
mwaskom merged 4 commits into
masterfrom
plot/label

Conversation

@mwaskom

@mwaskom mwaskom commented Jul 13, 2022

Copy link
Copy Markdown
Owner

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

codecov Bot commented Jul 13, 2022

Copy link
Copy Markdown

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