cleanplots is a Stata and R graphics scheme to change the default look of Stata graphics and R graphics with ggplot. It is designed to implement data visualization best practices by default—limiting the amount of time you have to spend tweaking the graph to be maximally readable and usable. In addition, the color palette is chosen to be colorblind friendly and to automate printing in black and white, so that a single figure will work in color or printed in black and white.
This site overviews the Stata version.
For the R version, see: https://tdmize.github.io/cleanplots/
The sections below detail (1) installation instructions, (2) the help file, (3) citation information, (4) features of the graphics scheme, (5) examples that compare cleanplots to Stata's default graphics scheme, (6) a note on updates to the scheme and prior versions, and (7) details on the R package version.
To install in Stata:
net install cleanplots, from("https://tdmize.github.io/data") replace
Once installed, to change your graphics scheme:
set scheme cleanplots, perm
Read the cleanplots help file by executing the following command (also available here):
help cleanplots
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
cleanplots implements a host of features that draw on best data visualization practices (some of which are borrowed from the excellent black and white graphics scheme plainplots from Bischof (2017)). This allows you to make publication quality Stata graphics with very little effort. With cleanplots, many of the defaults you would change before via code are already changed for you. For example:
Default colors are easier to distinguish from each other and are more aesthetically pleasing
Default colors are colorblind friendly
Default colors allow you to make one graph which is effective in both color and when printed in black and white
Nominal and ordinal color palettes are available so your colors match your data
Marker shapes and line features (e.g. solid, dashed, etc.) better distinguish lines and ensure lines will be distinguishable if printing in black and white
All axis markers are horizontal – thus easier to read
A non-invasive light grid is placed on all plots
Both vertical and horizontal gridlines
The background of the plot is white
Legends are placed to right of the graph, close to the data
Text colors on the graph are consistent
And many more!
One benefit of the cleanplots scheme is that you only need to create one set of figures because the colors and markers/symbols/lines cleanplots uses can be printed in black and white/grayscale and still be easily distinguished. The figures below illustrate the color and grayscale version of the same figures:
About 5% of the population has some form of colorblindness (red/green being the most common which is why you should always avoid having red and green together on your figure). This excellent website Coloring for Colorblindness lets you check your color schemes to see how they will be viewed for those who are colorblind.
The figure below shows how the first six default cleanplots colors ("true") look to individuals with various types of colorblindness. As the figure illustrates, the colors have been chosen because they are easily distinguishable across all types of colorblindness. There is no red–green pair; the first five colors pass deuteranopia, protanopia, and tritanopia simulation checks with a minimum ΔE of about 21; and the dark/light alternation keeps the first several groups distinguishable in grayscale by lightness alone.
The cleanplots scheme includes 10 total colors, shown below with their RGB and Hex codes. The default scheme is a nominal theme with no implied ordering from the colors (see below for an ordinal version).
For bar charts and area plots, which include lots of data ink, cleanplots uses a less saturated palette with softer versions of the same colors.
Color alone cannot be reliably used to distinguish more than four or five aspects of a graph for the whole population; if you have more aspects of the graph, always include additional varying markers, line patterns, or other differentiators. cleanplots automates this. The shape and pattern assignments are coordinated with the colors, with varying marker shapes and colors ensuring maximal distinguishability.
The default cleanplots colors are nominal, with no implied ordering.
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(cleanplots)
The ordinal colors are from the cividis palette (Nunez, Anderton, & Renslow 2018), a variant of viridis (Rudis, Ross and Garnier 2024) 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.
The full set of ordinal cleanplots# palettes:
This section illustrates default choices of some common plots using cleanplots (on the left) vs Stata's default graphics scheme (s2color; on the right). Note I recommend more polished figures for use in papers; these are only meant to illustrate the difference in the default choices.
hist vidtv, percent
marginsplot, recastci(rline) ciopts(lpat(dash))
twoway scatter residstd index [w=influence]
marginsplot, recast(scatter) x(educ)
cibar income, over1(occcat)
lowess job phd
cleanplots was given an update in July 2026. For the primary palette, of most focus is the color choices for colors 6 - 10, which are now more colorblind friendly and more easily distinguishable. And, the intensity of colors now alternate for each odd and even aspect of the graph, aiding in black and white printing. In addition, the cleanplots# schemes now provide options for ordinal palettes. Finally, the legend is now due right of the graph, instead of in the bottom right.
To obtain the newest version:
net install cleanplots, from("https://tdmize.github.io/data") replace
I recommend using the most up to date version. But, if you are feeling nostalgic and want the original scheme, it is preserved as cleanplots_classic:
set scheme cleanplots_classic
A companion cleanplots package is available for R. You can read more about the R package here: https://tdmize.github.io/cleanplots/