Distribution

Variable-width box plot

Adds group-size information by varying box width.

  • Plot
  • Distribution
  • Sample size

What it answers

How do distribution summaries and group sizes compare?

Shape
Boxes with different widths
What it shows
Spread, median and sample-size imbalance.

Example

The question

How do order values vary across stores of very different sizes?

Order value by store, box width shows number of orders (illustrative)

Order value by store, box width shows number of orders (illustrative)Box widths are in proportion to the square root of the number of orders. Big (400): median 39.6, middle half 33.9 to 46.2, range 10.5 to 75.9; Mid (100): median 50.8, middle half 40.5 to 60.4, range 16 to 83.5; Small (25): median 31.1, middle half 25.9 to 40.4, range 12.4 to 49.7.Order value (EUR)020406080100Big (400)Mid (100)Small (25)
Order value by store, box width shows number of orders (illustrative)Box widths are in proportion to the square root of the number of orders. Big (400): median 39.6, middle half 33.9 to 46.2, range 10.5 to 75.9; Mid (100): median 50.8, middle half 40.5 to 60.4, range 16 to 83.5; Small (25): median 31.1, middle half 25.9 to 40.4, range 12.4 to 49.7.Order value (EUR)020406080100Big (400)Mid (100)Small (25)
Box widths are in proportion to the square root of the number of orders. Big (400): median 39.6, middle half 33.9 to 46.2, range 10.5 to 75.9; Mid (100): median 50.8, middle half 40.5 to 60.4, range 16 to 83.5; Small (25): median 31.1, middle half 25.9 to 40.4, range 12.4 to 49.7.

Illustrative data. It belongs to no company.

When to use it

Use it when

Comparing distributions while showing unequal sample sizes.

Avoid it when

When width encoding is unexplained or masks small groups.

How to read it

Read each box's statistics, then width using the sample-size key.

Note

State whether width follows sample size or its square root.

The data you need

Layout
Long table
Fields
Group: text; Value: number
One row is
One raw observation belonging to a group. What is the grain?
Rules
Retain individual observations and group labels. State weighting and missing-data rules.
Optional
For box plots only, some tools accept Group,Q1,Median,Q3,WhiskerLow,WhiskerHigh plus separate outliers. Other distributions usually need raw data.
Preparation
Keep raw numeric observations, group them if needed and handle missingness explicitly. Choose bins, bandwidth or summary conventions as appropriate to this specific plot.
Units
The value axis uses original units; box width encodes sample size or a stated transformation of it.
Example of the input layout: Long tableA long table: one row per observation, few columns. New data adds rows.GroupValueAABBC
A long table: one row per observation, few columns. New data adds rows.

Worked example

Groups A: n 25 and B: n 100. If width follows square root of n, B is twice as wide as A, not four times.

GroupValue
A10
A12
A18
B11
B23