Title
cleanplots --
Graphics scheme that implements best data visualization
practices. Colors are color-blind friendly and remain
distinguishable when printed in black and white, with
coordinated marker symbols and line patterns so that groups stay
distinct across multiple visual channels.
Overview
cleanplots changes the default look and feel of Stata graphics. The
choices of colors, markers, line patterns, gridlines, legend placement,
and other aspects of the figure follow best data visualization practices,
with no per-graph effort needed.
The color palette is designed for accessibility. It contains no red-green
pair (red-green color blindness is the most common form, affecting roughly
8% of men), and the first five colors pass simulation checks for all three
major forms of color blindness. The palette also alternates darker and
lighter colors so that the first several groups remain distinguishable by
lightness alone when a figure is printed in black and white.
Color alone reliably distinguishes about 4-5 groups. Beyond that,
addiitonal markers or patterns are needed for distinguishability.
cleanplots automatically varies markers, line patterns, and other
features.
Bar charts, area plots, and pie charts automatically use softer versions
of the colors. These elements use far more ink than points and lines, so
full-strength colors overwhelm; cleanplots fades them for a cleaner look
while full-strength colors remain on markers, lines, and outlines.
The default cleanplots colors are a nominal palette, meaning no ordering
is implied by the colors or markers. When an ordered (ordinal) palette is
needed, use the cleanplots# schemes on a single graph (see Ordinal color
schemes below).
For more information and to see examples, see the cleanplots website here.
Many of the features of cleanplots are adapted from the excellent black
and white colorscheme plotplain.
Using cleanplots
To change your graphics scheme to cleanplots for all graphs:
set scheme cleanplots, perm
Or apply it to a single graph with the scheme() option:
sysuse auto, clear
graph twoway scatter price weight, scheme(cleanplots)
Stata's default graphic scheme is s2color. To change back to the default:
set scheme s2color, perm
The colors
The ten main colors, used for markers, lines, and confidence intervals
(shown as the Stata color definition and the resulting hex code):
# Definition Hex RGB
1 red*1.2 #D50000 213 0 0
2 eltblue*.9 #8FC6EB 143 198 235
3 black #000000 0 0 0
4 gs9 #909090 144 144 144
5 purple*1.1 #740074 116 0 116
6 pink*.3 #FFB3D9 255 179 217
7 navy*1.3 #143755 20 55 85
8 gs12 #C0C0C0 192 192 192
9 gs4 #404040 64 64 64
10 lavender*.35 #D9D7F0 217 215 240
Bars, areas, and pies use softer versions of the same colors (e.g.,
eltblue*.7, purple*.9), rendered with 70% intensity. You can verify any of
the colors interactively at Coloring for Colorblindness.
Ordinal color schemes
The default cleanplots colors are nominal, with no implied ordering:
sysuse auto, clear
graph bar price, over(rep78) asyvars scheme(cleanplots)
To have the colors reflect ordering, use the cleanplots# schemes on a
single graph. Five are available -- cleanplots3, cleanplots5, cleanplots7,
cleanplots9, and cleanplots11 -- where the number is how many sequential
colors the scheme provides. Colors run from light yellow to dark navy, so
higher categories are darker. For example, for a chart with 5 ordered
groups:
sysuse auto, clear
graph bar price, over(rep78) asyvars scheme(cleanplots5)
The ordinal colors are from the cividis palette (Nunez, Anderton, &
Renslow 2018), a variant of viridis (van der Walt & Smith 2015) optimized
so that readers with red-green color blindness see essentially the same
palette as everyone else. Because the colors run monotonically from light
to dark, the ordering itself also survives black and white printing.
The cleanplots# schemes inherit all layout, sizing, and legend settings
from the main cleanplots scheme, and each series gets a distinct line
pattern and marker symbol for maximum distinguishability. If a graph has
more groups than the scheme has colors, the colors recycle (e.g., under
cleanplots3 the 4th group repeats color 1) while the line patterns and
marker symbols continue to vary, so recycled groups never share both color
and pattern/symbol.
Updates
cleanplots was overhauled in July 2026 to ensure all 10 colors and the
choices of lines, markers, etc. are color-blind friendly and work as well
as possible in black and white. In addiiton, the ordinal cleanplots#
schemes were added. Finally, the legend was moved to be at the direct
right of the graph
I recommend using the updated scheme. But if you are feeling nostalgic,
the older version is preserved as cleanplots_classic.
cleanplots for R
A companion cleanplots package for R (ggplot2) shares this scheme's
colors, marker symbols, line patterns, and layout. See the full
documentation and details on downloading the R package at
tdmize.github.io/cleanplots.
Authorship
cleanplots is written by Trenton D Mize (Departments of Sociology &
Statistics [by courtesy] & The Methodology Center at Purdue University).
Questions can be sent to tmize@purdue.edu
Citation & References
In general, I do not think the use of a graphics scheme requires citation.
So for most cases, feel free to use cleanplots without citation. But, if
you need/want a citation you can cite cleanplots as:
Mize, Trenton D. 2017. "cleanplots: Stata graphics scheme for easy and
effective data visualizations."
https://www.trentonmize.com/software/cleanplots
If using the ordinal cleanplots# schemes, please also credit the cividis
colors:
Nunez, Jamie R., Christopher R. Anderton, and Ryan S. Renslow. 2018.
"Optimizing colormaps with consideration for color vision deficiency to
enable accurate interpretation of scientific data." PLOS ONE 13(7):
e0199239.
Back to top