Slope and Aspect

Two panels, one series. The left one starts its axis at zero; the right one crops to the data. Drag the height and watch both angles move while the numbers stay exactly where they were.

Loading interactive simulation...

One set of numbers, two different pictures 🖖

Both panels draw the same twelve numbers. The left one starts its axis at zero, the right one crops to the data, and the two angles printed above them are not close. Drag the height slider and watch them move together while the numbers underneath never change. That is the whole claim: steepness is not in the data. It is set by the range of the y axis and the shape of the box, and both of those were chosen by whoever drew the chart. So when someone says a chart shows a steep rise, they are describing an axis. The worked problem below pins it to exact figures on a stated 600 × 300 box, where the same line comes out at 20.1° or at 3.1° depending only on where the axis starts.

Two levers, and they cancel exactly 🖖

The angle obeys one formula: tan θ = slope × (pixels per y unit) ÷ (pixels per x unit). That leaves the author two levers, and they trade off precisely. Halve the y range and halve the box height, and the line comes out at the identical angle to nine decimal places. Which means there is no such thing as an unscaled chart. Every line chart ever drawn made this choice; most of them just did not tell you.

There is a defensible answer, and it looks wrong 🖖

Because the eye judges angles rather than slopes, it separates one steepness from another best when the segments sit near 45°. Choosing the aspect ratio to put the typical segment there is called banking to 45°, and it is arithmetic rather than taste. Press the button and the tool computes the height for your panel, and prints the width it used — a banked height means nothing on its own, because what is being chosen is a ratio. On a 600-pixel width this series wants 818 pixels of height. Taller than it is wide, which nobody would draw by instinct, and the honest shape for that data. Being able to compute the number is what turns "pick a sensible aspect ratio" into something you can check.

Problems solved in full

  1. Angle of a line that rises 2 units per step over 12 points 7 steps

    A chart is 600px wide and 300px tall, its y axis runs 95 to 125, and the line rises 2 units per step over 12 points. At what angle is it actually drawn?

    1. Work in pixels per unit. Twelve points make eleven gaps across 600 pixels, and the 30-unit axis is spread over 300 pixels.

    2. A step of 2 data units is therefore 20 pixels up, against 54.5 pixels across.

    3. That is the angle. Now open the axis to 0–200 and change nothing else. The vertical scale drops to 1.5 pixels per unit, so the same step is 3 pixels instead of 20.

    4. From 20.1° to 3.1°, with the identical twelve numbers. Anyone describing the first as a sharp climb and the second as flat is describing the axis.

    5. Now the check that shows the two levers are one. Halve the range to 15 units and halve the height to 150 pixels: the pixels per unit is unchanged, so the angle must be too.

    6. Banking asks the reverse question. What height puts the typical segment at 45°, where tan θ = 1 and the eye compares slopes best? Set the pixel rise equal to the pixel run and solve for the height.

    7. 818 pixels tall against 600 wide. That is the shape this data wants, and it is not a shape anyone draws by instinct — which is the reason to compute it rather than eyeball it.

    Answer

    20.1°, and it could just as honestly have been 3.1°. The angle is fixed by the axis range and the box, and those two cancel exactly, so no chart is unscaled. Banking to 45° gives a defensible answer for this series: 818 pixels tall on a 600-pixel width.

  2. A rise and a fall in the ratio 3 to 1, and the shape that shows it 7 steps

    Press Slow up, fast down. The series climbs six steps and drops back in two, and at the default shape the two limbs look much alike. Find the height that makes them most different — then decide whether the tool's own Bank the right panel to 45° button gives it to you.

    1. Read the numbers off before looking at the picture. Seventeen points, sixteen steps, and only two of them in the whole series: a rise of 5 twelve times and a fall of 15 four times. Nothing else is in this data.

    2. So the median step is 5 and the ratio of the two limbs is exactly 3. That ratio is a property of the numbers and no aspect ratio can touch it — which is precisely why the picture is free to lie about it.

    3. Give the median segment a pixel slope and call it s. The steep limb is then at 3s, and the angles you actually see are the arctangents. The whole question is which s to choose.

    4. Banking to 45° chooses s = 1, which is what the button does: it scales the height until the median segment sits at 45°. The rise limb lands on 45.000° and the fall on 71.565°, a separation of 26.565°.

    5. But separation was never what banking was maximising, so ask for it directly. Differentiate the gap between the two angles and set it to zero. The 3s and the s pull against each other, the algebra collapses to a single quadratic, and the answer is 1/√3.

    6. At that shape the two limbs come out at 30° and 60°, and the separation is 30.000° — three and a half degrees more than the banked shape gives, from a box a little over half as tall.

    7. The two answers are complementary and that is not a coincidence of the number 3. The most distinguishable pair always sits symmetric about 45°, which is to say the geometric mean of the two slopes is what belongs at 45°. Cleveland's rule is that statement for a series whose slopes are all the same size.

    Answer

    30° and 60°, at 0.577 of the banked height. Whatever number the Bank to 45° card gives for your panel, multiply it by 0.577 and the asymmetry in this series is as visible as it can be made.

    Banking is still the right default and this is not an argument against it. It maximises how well an eye can tell one slope from another across a whole set of them, using the median as a stand-in for the typical case, and on a series with many different slopes that is the correct thing to do. This series has two. When a data set has a small number of distinct slopes and the question is whether they differ, the median is standing in for nothing and the geometric mean is the quantity that matters — √(5 × 15) rather than 5.

    Which is worth knowing because the series that made banking famous has this shape. Drawn tall, the sunspot record looks like a row of symmetric humps; drawn short and wide, as Cleveland drew it, the cycles are plainly steeper going up than coming down. The aspect ratio was the whole difference. The arithmetic above says how short to make it, and says that when a series has two slopes rather than many, the honest answer is shorter still than the rule he wrote down.

References (2)
  • Banking to 45 degrees: the aspect ratio the tool computes, and why that angle Cleveland, W. S., McGill, M. E. and McGill, R. (1988). The Shape Parameter of a Two-Variable Graph. Journal of the American Statistical Association, 83(402), 289–300. doi:10.1080/01621459.1988.10478598
  • Where the perceptual claim underneath it comes from Cleveland, W. S. (1993). Visualizing Data. Hobart Press. — on judging slope, and on aspect ratio as a parameter of the display rather than of the data.

Example problems

  • A straight rise - A dead straight line, up 2 every step. Cropped to the data it climbs nearly five times as steeply as it does from zero. Same twelve numbers, and the two angles both move if you resize the window.
  • Flat, with noise - Nothing is happening here — the values wander inside a band four units wide. Plotted from zero the line looks flat. Cropped to the data’s own range, the same wandering fills the panel and reads as a climb, and the two angle readouts are nowhere near each other. Neither angle is a property of the data: both depend on how wide the panel is.
  • Slow up, fast down - This one really does rise slowly and fall fast, by exactly three to one. How much faster it looks depends on the box: squash it flat and the fall reads three times steeper, bank it to 45° and the same fall reads 1.6 times. The asymmetry is real, the number you would quote for it is not.