LibreOffice Calc · Charts and visualization · Advanced
Construct a Box Plot with Min–Max Whiskers in LibreOffice Calc
Build a positive-data box plot from stacked columns and cell-range error bars, with an explicit quartile method and independently checked endpoints.
Calc Guide 26.2 construction reviewed; quartile and stack arithmetic checked; native chart rendering untested · Editorial standards
Calc Guide 26.2 describes a manual stacked-column construction, not a dedicated box-plot chart type. You calculate summary values, turn them into stack heights, hide helper stacks and attach directional error bars. The visible box spans the first to third quartiles, with a boundary at the median.
This tutorial follows that construction for strictly positive data. Its whiskers reach the sample minimum and maximum. They are not Tukey 1.5×IQR whiskers, and it does not identify or plot outliers separately. Do not label the result as a Tukey box plot.
The source is Calc Guide 26.2, Chapter 7. Directions refer to desktop Calc’s English chart interface. The data, quartiles and geometry were independently checked; no chart was created or visually tested in Calc for this article. The procedure needs reader verification in the installed build.
Download two positive samples
Download the original practice CSV. It contains two headings and eight numeric observations per column. It contains no chart, formulas, macros or real personal data, and is not a native Calc output.
Import the headings into A1:B1 and the values into A2:B9:
| Set A | Set B |
|---|---|
| 2 | 3 |
| 4 | 5 |
| 5 | 6 |
| 7 | 7 |
| 8 | 9 |
| 10 | 11 |
| 12 | 13 |
| 16 | 19 |
The order is sorted only to make manual checking easy. The two sets need not represent paired observations. Do not treat rows as pairs just because the columns have the same length.
Choose the quartile convention explicitly
This eight-observation exercise uses QUARTILE.EXC, matching the guide’s even-count example convention. Quartile definitions are a methodological choice, not a universal rule that sample parity settles. Do not silently switch conventions when a later observation changes the count.
For n = 8, the exclusive method places Q1 at sorted position (n+1)×0.25 = 2.25 and Q3 at position 6.75, interpolating between adjacent values. Set A therefore has Q1 = 4 + 0.25×(5−4) = 4.25 and Q3 = 10 + 0.75×(12−10) = 11.5.
Enter summary headings in D1:F1: Statistic, Set A, Set B. Use these rows:
| Row | D label | Formula in E | Expected E | Expected F |
|---|---|---|---|---|
| 2 | Minimum | =MIN(A2:A9) |
2 | 3 |
| 3 | Q1 | =QUARTILE.EXC(A2:A9;1) |
4.25 | 5.25 |
| 4 | Median | =MEDIAN(A2:A9) |
7.5 | 8 |
| 5 | Q3 | =QUARTILE.EXC(A2:A9;3) |
11.5 | 12.5 |
| 6 | Maximum | =MAX(A2:A9) |
16 | 19 |
In F2:F6 use the corresponding B2:B9 range. Formulas here use English names and semicolons. Use your configured syntax where different. The official statistical-function Help distinguishes the exclusive and inclusive methods. The QUARTILE.EXC guide owns the function contract; this workflow owns the chart construction.
Convert endpoints into stack heights
Plotting the five summary values directly as a stacked chart adds endpoints together and produces the wrong heights. Instead, enter H1:J1 as Piece, Set A, Set B and calculate:
| Row | H label | Formula in I | Expected I | Expected J |
|---|---|---|---|---|
| 2 | Base | =E2 |
2 | 3 |
| 3 | Lower whisker gap | =E3-E2 |
2.25 | 2.25 |
| 4 | Lower half-box | =E4-E3 |
3.25 | 2.75 |
| 5 | Upper half-box | =E5-E4 |
4 | 4.5 |
| 6 | Upper whisker gap | =E6-E5 |
4.5 | 6.5 |
Column J uses F2:F6 in the equivalent formulas. Check that each column’s five pieces sum to its maximum: 16 and 19. The cumulative top of the second piece is Q1; the third reaches the median; the fourth reaches Q3. These cumulative positions determine which series must own each whisker.
This recipe deliberately excludes zero/negative minima. Positive and negative values stack differently; changing the axis minimum does not repair an unsuitable stack construction. It also does not certify degenerate zero-height quartile boxes.
Create and identify the five series
Select H1:J6 and choose Insert → Chart. Choose a 2D stacked Column chart, with data series in rows, the first row as labels and first column as labels. The two categories should be Set A and Set B; the five series should be the five Piece labels. Do not choose percent-stacked or 3D.
Check the series order before hiding anything: Base, Lower whisker gap, Lower half-box, Upper half-box, Upper whisker gap. In chart edit mode, use the chart-element selector to choose the intended series if clicking a narrow segment is difficult. Keep the data and formulas; hiding a helper’s fill is not deleting its series.
Format the Base, Lower whisker gap and Upper whisker gap series with no visible fill and no visible border. Leave both half-box series visible, with matching fill and continuous borders so their meeting line marks the median. Remove the legend because invisible helper series are not meaningful explanatory categories. Label the chart clearly: Exclusive quartiles; whiskers = minimum and maximum.
Attach error bars to the correct cumulative levels
For the Lower whisker gap series, insert Y Error Bars. Choose Cell Range, use the negative-only indicator, and reference I3:J3 for the negative amounts. The bar starts at each series’ cumulative top, Q1, and extends down by Q1−minimum. Do not attach it to Base: that would start from the minimum and extend below it.
For the Upper half-box series, insert Y Error Bars with Cell Range and the positive-only indicator. Reference I6:J6 for the positive amounts. The bar starts at Q3 and extends to the maximum. Do not attach it to Upper whisker gap, whose cumulative top is already the maximum.
Use visible continuous error-bar lines and box borders. The guide illustrates a 0.03 cm line width; adjust for the actual presentation size rather than treating that width as a statistical setting. Formatting a hidden helper series must not hide its error bar: inspect the result explicitly.
Verify every landmark, not just the appearance
The finished geometry should be:
| Set | Lower whisker | Box bottom | Median line | Box top | Upper whisker |
|---|---|---|---|---|---|
| A | 2 | 4.25 | 7.5 | 11.5 | 16 |
| B | 3 | 5.25 | 8 | 12.5 | 19 |
If those landmarks do not match, inspect series order, row orientation, helper visibility and error-bar owners. A plausible-looking box does not establish correct quartiles. Keep this summary table beside the chart as a readable numerical alternative.
Change only A9 from 16 to 24 in a separate practice copy. Under the fixed exclusive convention, Set A’s Q1, median and Q3 remain 4.25, 7.5 and 11.5; its upper gap becomes 12.5 and upper whisker must reach 24. Restore 16 afterward. Do not assume chart ranges extend automatically when more observations are appended.
Save and reopen the ODS, then check the series ranges, both error-bar ranges and all five landmarks. No native rendering, exported-format fidelity or save/reopen result is claimed here. For ordinary uncertainty bars or fitted trends, use the separate trendline and error-bar workflow; those have different meanings from these constructed min–max whiskers.