Ordering Categories in a Chart

Category order changes how readers compare neighbors. Meaningful domain order and frequency order answer different questions.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace size values
  2. Keep comparable views aligned

Trace size values

Small, medium, and large usually suggest a natural order even when medium has the fewest observations. A ranking chart can instead place the largest count first. Key-based sorting describes the chosen key.

Keep comparable views aligned

If two panels reorder the same categories independently, a reader may compare different labels by position. Use an explicit ordering contract and title. Stable output ordering applies to the underlying query.[1][2]

References

  1. Hadley Wickham, Tidy Data ↩
  2. Matplotlib Development Team, Plot Types ↩