Charles Petzold



Swing States Graph, Logarithmic Style

December 29, 2023
Roscoe, New York

Earlier today I published a blog entry with an interactive graph that had some visual flaws. Here’s that questionable graph again:

Your browser does not support the canvas element.

This graph is intended to show the influence of swing states over six Presidential election years. The Electoral Influence values are shown at the left, ranging from 0 to 2. The election years are across the top. Moving your mouse on one of the states at the right highlights the dots and connecting lines for that state.

This graph has two problems:

1. Some values of Electoral Influence are so high (as high as 46) that they go way off the top of the chart.

2. Many of the states have Electoral Influence values so low that they are clustered down at the bottom.

These two problems are actually one problem. The problem is that I used a linear axis for Electoral Influence when I should have been using a logarithmic axis.

In a linear axis, the same distance separates 0.0 and 0.1 as separates 1.9 and 2.0. In a logarithmic axis, the same distance separates 0.1 and 1.0 as separates 1 and 10. This is because the logarithm reduces powers of 10 to the power itself:

   log(100) = 2
   log(10) = 1
   log(1) = 0
   log(0.1) = –1
   log(0.01) = –2

Here’s the same graph using a logarithmic scale for the Electoral Influence:

Your browser does not support the canvas element.

Everything is now spread out much better but in a very systematic way.

I read recently someone complaining that a graph with a logarithmic scale was intended to deceive people by distorting the axis. But the intent is not to deceive but to clarify.