Skip to content

Match legend order to visual data order

badcolor and encodingmechanicalWilke 2019 p. 248

Which site generated the most electricity?

Illustrative annual output records for three municipal solar arrays.

“If there is a visual ordering in your data, make sure to match it in the legend”

Claus O. Wilke, "Fundamentals of Data Visualization", p. 248.
CVD preview

Before

Legend entries mix up the order of the area boundaries.

Download before Python code

After

Direct labels follow the depot, library and pool boundaries from top to bottom.

Download after Python code

Values

The latest two years show output rising at all three sites.

The six-year record shows a dip in 2022 followed by recovery at all three sites.