Skip to content

Keep data markers clear of the axis frame

badlayout and typemechanicalCleveland 1994 p. 31Few 2012 p. 193

Are the extreme minimum and maximum flowers clearly visible or clipped by the axis lines?

Plotly Express Iris dataset, 50 Iris setosa observations.

“Do not let the data rectangle coincide with the scale-line rectangle, and inset the data slightly inside the frame”

William S. Cleveland, "The Elements of Graphing Data", revised edition, p. 32.

Also covered in Cleveland 1994 (2.2 Visual Clarity, p. 31), Few 2012 (9 GENERAL GRAPH DESIGN, p. 193).

CVD preview

Before

Setting axis limits exactly to the data minimum and maximum slices the extreme markers (4.3 cm length and 2.3 cm width) in half along the frame lines.

Download before Python code

After

Expanding both axis ranges by roughly 6% insets every observation cleanly inside the plotting frame.

Download after Python code

Values

Setosa sepals span 4.3 to 5.8 cm in length and 2.3 to 4.4 cm in width.

All 50 setosa observations, including the smallest at (4.5, 2.3) cm and largest at (5.7, 4.4) cm, appear whole.

Values used in both charts
MeasurementMin (cm)Max (cm)Count
Sepal length4.35.850
Sepal width2.34.450