cleanplots 

Stata graphics scheme for easy and effective data visualizations

Overview

cleanplots is a Stata graphics scheme to change the default look of Stata graphics. 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. It is especially designed for better and easier default graphs of predictions and marginal effects. 

The sections below detail (1) installation instructions, (2) the help file, (3) features of the graphics scheme, and (4) examples that compare cleanplots to Stata's default graphics scheme. 

(1) Installation Instructions 

To install in Stata:

    net install cleanplots, from("https://tdmize.github.io/data/cleanplots") replace

Once installed, to change your graphics scheme:

    set scheme cleanplots, perm

(2) Help file

Read the cleanplots help file by executing the following command (also available here):

    help cleanplots

(3) Citation

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

(4) Details on cleanplots scheme.

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:


Color figures convert automatically to grayscale

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:

Creating figures considerate of colorblindness

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 four 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.

(5) Examples 

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(degree) over2(woman)

 

lowess job phd