seaborn icon indicating copy to clipboard operation
seaborn copied to clipboard

Add support for per-category width on boxplot.

Open elmer-garduno opened this issue 5 years ago • 4 comments

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.

elmer-garduno avatar Feb 14 '20 23:02 elmer-garduno

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@71a807b). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            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.

codecov[bot] avatar Feb 15 '20 00:02 codecov[bot]

I think that if this were going to be supported, it would have to be similar to how that option works in violinplot.

mwaskom avatar Feb 15 '20 00:02 mwaskom

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 .

elmer-garduno avatar Feb 15 '20 01:02 elmer-garduno

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 .

elmer-garduno avatar Feb 15 '20 15:02 elmer-garduno

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!

mwaskom avatar Mar 15 '23 01:03 mwaskom