Log scale
A log scale is an axis where each equal step multiplies the value instead of adding to it, so 1,000, 10,000 and 100,000 sit evenly spaced.
It helps when values span several orders of magnitude, like GDP per capita from 1,000 to 50,000 dollars. On a regular (linear) axis the lower values bunch up at the left. On a log axis they spread out, and equal ratios look like equal distances.
In Altair:
python
alt.X('gdp_per_capita:Q').scale(type='log')In ggplot2 it's scale_x_log10(), and in Stata xscale(log). A log scale shows positive values only.
Learn more
Related terms
- Altair
Altair (Vega-Altair) is a Python package for making charts by describing them: you say which column goes on each axis, color or size, and it writes the Vega-Lite that draws the chart.