Stata package for creating user-defined scheme files using research-based color palettes

2 years after


A help file was added for the brewcolors command and all brewtheme specific and brewscheme documentation has been updated. There have been some minor refactorings implemented to change instances of the option refresh to the more typical Stata syntax replace.


A data visualization toolkit for Stata. This package contains Stata programs; Mata functions, classes, and methods; and Java plugins to make customizing graphs in Stata easier. The major functionality is provided by the brewtheme and brewscheme programs which generate a .theme file (for aesthetic settings that are not specific to a graph/plot type) and .scheme files (which inherit the .theme files and set aesthetic properties specific to plot/graph types). In addition to the user specified/requested aesthetics, these programs also leverage the libbrewscheme Mata library to generate parallel versions of these files with values that simulate the appearance to individuals with achromatopsia (complete color blindness), protanopia (red color sight impairment), deuteranopia (green color sight impairment), and tritanopia (blue color sight impairment).

There are additional programs for color interpolation (brewterpolate), translation between hexadecimal and RGB color spaces (hextorgb), estimating simulated RGB values for the forms of color sight impairments listed above (libbrewscheme), a color palette previewer (brewviewer), and a color vision simulator (brewcbsim).

Together, this provides users with a powerful toolkit to customize their data visualizations generated in Stata and makes it easier and faster to incorporate Stata code into production environments that require standardization.


To view examples, please see the project website.


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

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

Krzywinski, M. (2015). Color palettes for color blindness. Retrieved on: 22nov2015. Retrieved from:

Lin, S., Fortuna, J., Kulkarni, C., Stone, M., {c 38} Heer, J. (2013). Selecting Semantically-Resonant Colors for Data Visualization. Computer Graphics Forum 32(3) pp. 401-410. Retrieved from

Lindbloom, B. (2001). RGB working space information. Retrieved from: Retrieved on 24nov2015.

Meyer, G. W., & Greenberg, D. P. (1988). Color-Defective Vision and Computer Graphics Displays. Computer Graphics and Applications, IEEE 8(5), pp. 28-40. Retrieved from: Retrieved on: 26nov2015

Smith, V. C., & Pokorny, J. (2005). Spectral sensitivity of the foveal cone photopigments between 400 and 500nm. Journal of the Optical Society of America A, 22(10), pp. 2060-2071. Retrieved from: Retrieved on: 26nov2015

Wickham, H. (2009). ggplot2: Elegant Graphics for Data Analysis. New York City, NY: Springer Science+Business Media LLC.

Wickline, M. (2014). Color.Vision.Simulate, Version 0.1. Retrieved from: Retrieved on: 24nov2015.

License Information

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

Additional Info

For additional information/examples about the brewscheme package see Buchanan, W. R. (2015). Brewing color schemes in Stata: Making it easier for end users to customize Stata graphs. Presented 31jul2015 at the 2015 Stata North American Users' Group Meeting. Columbus, OH.

Top Contributors



-   v1.0.0 zip tar
-   v1.0.0-rc2 zip tar
-   v1.0.0-rc zip tar
-   RC1 zip tar