seaborn
seaborn copied to clipboard
Add support for per-category width on boxplot.
Support per-category width on boxplot. As discused on https://github.com/mwaskom/seaborn/issues/1668, this is done by passing an array of widths on the sns.boxplot(width) argument.
Please let me know if this makes sense. I can add further testing.
Codecov Report
:exclamation: No coverage uploaded for pull request base (
master@71a807b
). Click here to learn what that means. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #1962 +/- ##
=========================================
Coverage ? 95.16%
=========================================
Files ? 12
Lines ? 4468
Branches ? 0
=========================================
Hits ? 4252
Misses ? 216
Partials ? 0
Impacted Files | Coverage Δ | |
---|---|---|
seaborn/algorithms.py | 100.00% <0.00%> (ø) |
|
seaborn/axisgrid.py | 94.98% <0.00%> (ø) |
|
seaborn/matrix.py | 95.08% <0.00%> (ø) |
|
seaborn/palettes.py | 96.89% <0.00%> (ø) |
|
seaborn/relational.py | 99.49% <0.00%> (ø) |
|
seaborn/distributions.py | 84.86% <0.00%> (ø) |
|
seaborn/utils.py | 87.41% <0.00%> (ø) |
|
seaborn/regression.py | 96.17% <0.00%> (ø) |
|
seaborn/categorical.py | 96.37% <0.00%> (ø) |
|
seaborn/__init__.py | 100.00% <0.00%> (ø) |
|
... and 2 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 71a807b...ae1888b. Read the comment docs.
I think that if this were going to be supported, it would have to be similar to how that option works in violinplot.
Thanks, you mean in terms of preserving the area? Or in terms of automatically using the number of samples to determine the relative width?
On Fri, Feb 14, 2020, 4:37 PM Michael Waskom [email protected] wrote:
I think that if this were going to be supported, it would have to be similar to how that option works in violinplot.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mwaskom/seaborn/pull/1962?email_source=notifications&email_token=AAJGIIGNHOFRDGGC53I74UDRC42M5A5CNFSM4KVRIXFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL24MGI#issuecomment-586532377, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJGIICHD4IC62P3OJ7O4N3RC42M5ANCNFSM4KVRIXFA .
I see, do you mean using the scale parameter instead and preserve the semantics of weight as they are?
If so that makes sense, let me try it.
On Fri, Feb 14, 2020, 5:51 PM Elmer [email protected] wrote:
Thanks, you mean in terms of preserving the area? Or in terms of automatically using the number of samples to determine the relative width?
On Fri, Feb 14, 2020, 4:37 PM Michael Waskom [email protected] wrote:
I think that if this were going to be supported, it would have to be similar to how that option works in violinplot.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mwaskom/seaborn/pull/1962?email_source=notifications&email_token=AAJGIIGNHOFRDGGC53I74UDRC42M5A5CNFSM4KVRIXFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL24MGI#issuecomment-586532377, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJGIICHD4IC62P3OJ7O4N3RC42M5ANCNFSM4KVRIXFA .
This is now obviated (without explicit effort to enable it) by #3294:
sns.boxplot(data=tips, x="day", y="total_bill", widths=[.2, .4, .6, .8])

It doesn't work with hue
; enabling that would be rather difficult and I lean not worth it.
Thanks for your interest!