*! version 1.0.0 21MAR2016

Command to generate customized scheme files.

help for brewscheme

brewscheme -- A program for easy generation of customized graph
scheme files.

Syntax

brewscheme , schemename(scheme name)
[ refresh
allstyle(string) allcolors(real 3)
allsaturation(real 100)
somestyle(string)
somecolors(real 3) somesaturation(real 100)

barstyle(string) barcolors(real 3)
barsaturation(real 100)
scatstyle(string)
scatcolors(real 3) scatsaturation(real 100)

areastyle(string) areacolors(real 3)
areasaturation(real 100)
linestyle(string)
linecolors(real 3) linesaturation(real 100)

boxstyle(string) boxcolors(real 3)
boxsaturation(real 100)
dotstyle(string)
dotcolors(real 3) dotsaturation(real 100)

piestyle(string) piecolors(real 3)
piesaturation(real 100)
sunstyle(string)
suncolors(real 4) sunsaturation(real 100)

histstyle(string) histcolors(real 3)
histsaturation(real 100)
cistyle(string)
cicolors(real 3) cisaturation(real 100)

matstyle(string) matcolors(real 3)
matsaturation(real 100)
reflstyle(string)
reflcolors(real 3) reflsaturation(real 100)

refmstyle(string) refmcolors(real 3)
refmsaturation(real 100)
constart(string)
conend(string) consaturation(real 100)
themefile(string)]

Description

brewscheme is a tool to facilitate Stata users developing
graph schemes using research-based color palettes. Unlike other uses of the
color palettes developed by Brewer (see References
below), this program allows users to specify the number of colors from any of
the 35 color palettes they would like to use and allows users to mix/combine
different palettes for the various graph types available in Stata. Additionally,
as a way of creating a centralized source for the Stata community to work from,
palettes from outside of ColorBrewer are being added to boost the capabilities
of the program.

Available Palettes

Qualitative Divergent

accent Brewer (2002) brbg Brewer (2002)
dark2 Brewer (2002) piyg Brewer (2002)
paired Brewer (2002) prgn Brewer (2002)
pastel1 Brewer (2002) puor Brewer (2002)
pastel2 Brewer (2002) rdbu Brewer (2002)
set1 Brewer (2002) rdgy Brewer (2002)
set2 Brewer (2002) rdylbu Brewer (2002)
set3 Brewer (2002) rdylgn Brewer (2002)
spectral Brewer (2002)

Sequential Non-ColorBrewer Palettes

blues Brewer (2002) tableau Lin et al (2013)
bugn Brewer (2002) fruita Lin et al (2013)
bupu Brewer (2002) fruite Lin et al (2013)
gnbu Brewer (2002) veggiesa Lin et al (2013)
greens Brewer (2002) veggiese Lin et al (2013)
greys Brewer (2002) drinksa Lin et al (2013)
orrd Brewer (2002) drinkse Lin et al (2013)
oranges Brewer (2002) brandsa Lin et al (2013)
pubu Brewer (2002) brandse Lin et al (2013)
pubugn Brewer (2002) fooda Lin et al (2013)
purd Brewer (2002) foodt Lin et al (2013)
purples Brewer (2002) carsa Lin et al (2013)
rdpu Brewer (2002) carst Lin et al (2013)
reds Brewer (2002) featuresa Lin et al (2013)
ylgn Brewer (2002) featurest Lin et al (2013)
ylgnbu Brewer (2002) activitiesa Lin et al (2013)
ylorbr Brewer (2002) activitiest Lin et al (2013)
ylorrd Brewer (2002) mdebar http://www.mde.k12.ms.us
mdepoint http://www.mde.k12.ms.us

Ordinal D3js

category10 D3 category20 D3
category20b D3 category20c D3

Options

schemename is used to name the scheme that will be created by
the program. Unless absolutely necessary, I highly recommend avoiding embedded spaces in these file names.

refresh if the source dataset containing the color palettes
is not found or the user specifies the refresh option, colorbrewscheme
will rebuild the source data set to generate the scheme files.

Single Color Palettes and Default Color Palettes

allstyle The lower-cased name of a color palette to be used for
all graph types.

allcolors The maximum number of colors to use from the palette
specifed by the allstyle option.

allsaturation Used to set the color intensity for all graph types.

somestyle The lower-cased name of a color palette to be used for
graph types without specified color palettes.

somecolors The maximum number of colors to use from the
palette specifed by the somestyle option.

somesaturation Used to set the color intensity for graph
types without specified color palettes.

themefile Is an optional argument used to supply brewscheme with a theme file created by brewtheme. Theme files are used to control global aesthetic properties (e.g., background/foreground colors, text sizes, symbol sizes, etc...) that are typically independent of the data being visualized.

Individual Graph Types

Bar Graphs

barstyle The lower-cased name of a color palette that will be
used to define colors for bar graphs.

barcolors The maximum number of colors to use from the
palette specifed by the barstyle option.

barsaturation Used to set the color intensity for bar graphs.

Scatterplots

scatstyle The lower-cased name of a color palette that will be
used for scatter plots.

scatcolors The maximum number of colors to use from the
palette specifed by the scatstyle option.

scatsaturation Used to set the color intensity for scatterplots.

Area Graphs

areastyle The lower-cased name of a color palette to be used for
area graphs

areacolors The maximum number of colors to use from the
palette specifed by the areastyle option.

areasaturation Used to set the color intensity for area graphs.

Line Graphs

linestyle The lower-cased name of a color palette to be used for
line graphs.

linecolors The maximum number of colors to use from the
palette specifed by the linestyle option.

linesaturation Used to set the color intensity for line graphs.

Box Plots

boxstyle The lower-cased name of a color palette to be used for
box plots.

boxcolors The maximum number of colors to use from the
palette specifed by the allstyle option.

boxsaturation Used to set the color intensity for box plots.

Dot Plots

dotstyle The lower-cased name of a color palette to be used for
dot plots.

dotcolors The maximum number of colors to use from the
palette specifed by the dotstyle option.

dotsaturation Used to set the color intensity for dot plots.

Pie Graphs

piestyle The lower-cased name of a color palette to be used for
pie graphs.

piecolors The maximum number of colors to use from the
palette specifed by the piestyle option.

piesaturation Used to set the color intensity for pie graphs.

Sunflower Plots

sunstyle The lower-cased name of a color palette to be used for
sunflower plots. Note, only the first four colors will be used.

suncolors The maximum number of colors to use from the
palette specifed by the sunstyle option.

sunsaturation Used to set the color intensity for sunflower plots.

Histograms

histstyle The lower-cased name of a color palette to be used for
histograms.

histcolors The maximum number of colors to use from the
palette specifed by the histstyle option.

histsaturation Used to set the color intensity for histograms.

Confidence Intervals

cistyle The lower-cased name of a color palette to be used for
graphs containing confidence intervals.

cicolors The maximum number of colors to use from the
palette specifed by the cistyle option.

cisaturation Used to set the color intensity for confidence intervals.

Scatterplot Matrices

matstyle The lower-cased name of a color palette to be used for
scatter plot matrices.

matcolors The maximum number of colors to use from the
palette specifed by the matstyle option.

matsaturation Used to set the color intensity for scatterplot matrices.

Reference Lines

reflstyle The lower-cased name of a color palette to be used for
reference lines.

reflcolors The maximum number of colors to use from the
palette specifed by the reflstyle option.

reflsaturation Used to set the color intensity for reference lines.

Reference Markers

refmstyle The lower-cased name of a color palette to use for
reference markers.

refmcolors The maximum number of colors to use from the
palette specifed by the refmstyle option.

refmsaturation Used to set the color intensity for reference markers.

Contour Plots

constart Defines the starting color to be used for contour
plots using standard colorstyles from Stata.

conend Defines the ending color to be used for contour
plots using standard colorstyles from Stata.

Examples

Generate a graph scheme using the set1 color brewer palette for all
graphs. Use the first five colors of the palette and set the color intensity to
80 for each of the graphs.

brewscheme, scheme(set1) allst(set1) allc(5) allsat(80)

Generate a graph scheme using the set1 color brewer palette for
scatterplots, pastel1 for bar graphs, and brown to blue-green for all other
graph types. Use the default values of colors and intensity for each.

brewscheme, scheme(mixed1) scatst(set1) barst(pastel1) somest(brbg)

Note, this program only creates the scheme file. To achieve the intended effect, you must use the scheme file in your subsequent graph commands:

sysuse auto.dta, clear

gr box mpg, over(rep78) scheme(mixed1)

References

Bostock, M., Ogievetsky, V., & Heer, J. (2011). D3: data driven documents. IEEE Transactions on Visualization & Computer Graphics. 17(12) pp 2301 - 2309. Retrieved from
Stanford Vis Group.

Brewer, C. A. (2002) Color Brewer 2 [Computer Software]. State College, PA: Cynthia Brewer, Mark Harrower, and The Pennsylvania State University.

Lin, S., Fortuna, J., Kulkarni, C., Stone, M., & Heer, J. (2013). Selecting Semantically-Resonant Colors for Data Visualization. In
Computer Graphics Forum (Vol. 32, No. 3pt4, pp. 401-410). Blackwell Publishing Ltd.

License

Please view section 4
of the ColorBrewer copyright notice for additional information pertaining to the licensing and redistribution of ColorBrew intellectual property.

Author

William R. Buchanan, Ph.D.

Data Scientist

Minneapolis Public Schools

William.Buchanan at mpls [dot] k12 [dot] mn [dot] us

Notes

Development of this program began while I was a Strategic Data Fellow at the Mississippi Department of Education.