Written and maintained by CASRAI Editorial Board
Last updated
Stata colors are controlled in two layers: a scheme sets the overall look of a graph, and color options such as mcolor() and lcolor() override the color of individual items. Every color option accepts a colorstyle: a named color, an RGB, CMYK, HSV or hexadecimal value, optionally followed by an intensity or an opacity. Since Stata 18 the default scheme is stcolor, so older tutorials that show different default colors were usually drawn with s2color.
What it is used for in research
Color choices decide whether a figure survives its journey from screen to print. Stata’s manual describes colorstyle as the setting that “sets the color and opacity of graph components such as lines, backgrounds, and bars.” In practice, researchers use it to keep group colors consistent across the figures in one paper, to make overlapping points readable with opacity, and to match a journal’s color requirements. The same options apply to the charts covered in our guides to histograms in Stata, box plots in Stata and scatterplots in Stata.
Install or access (official source only)
Colors are built into Stata; there is nothing to install. Two official commands help you explore them:
graph query colorstylelists the named colors.palette colorpreviews a color (see the [G-2] palette entry in the Stata manuals).graph query, schemeslists the schemes installed on your copy.
Step-by-step task
1. Know what your default scheme is
The Stata schemes documentation states: “If you have not used the set scheme command to change your default scheme, your default scheme is stcolor.” The Stata 18 graph-style page describes stcolor as the new default, with a brighter color palette and black reference lines. Histogram fills use stc1 at 90% intensity with the outline at 70%.
2. Set a color on one graph item
- Pick the option for the item:
mcolor()for markers,lcolor()for lines,bcolor()for bars, or the generalcolor()that applies to all affected objects. - Give it a colorstyle, for example a named color such as
navy,maroonorteal. - Run the command. The manual notes that, whatever scheme you choose, options such as
mcolor()andlcolor()control the color of each item.
3. Choose the right format
| You want | Syntax | Example from the manual |
|---|---|---|
| A named color | the color name | black, white, blue, red, green, yellow, orange, navy, maroon, teal |
| A gray | gs0 (black) to gs16 (white) |
gs0, gs16 |
| A scheme color | stc1 to stc15, stblue, stgreen, stred, styellow |
stc1 |
| RGB | "# # #" |
white is “255 255 255”; navy is “26 71 111” |
| Hexadecimal | "#RRGGBB" |
red is “#FF0000” |
| HSV | "hsv # # #" |
white is “hsv 0 0 1” |
| CMYK (only when a journal or publisher supplies it) | "# # # #" |
yellow is “0 0 255 0” |
| Invisible | none |
none |
| Darker or lighter | colorstyle*# (no space) |
green*.8 is lighter; purple*1.5 is darker |
| Transparency | colorstyle%#, 0 to 100 |
green%50; “0 255 0%50” |
Per the manual, an intensity of 1 leaves the color unchanged, a value greater than 1 makes the color darker, and a value less than 1 makes it lighter. For opacity, 100% fully hides the background and 0% is fully transparent, so color%0 equals none.
4. Fix overplotting with opacity
With graph twoway scatter, mcolor(%30) draws the default marker fill at 30% opacity, so overlapping points show through each other. Likewise, with graph twoway bar, bcolor(*.7) draws the default fill at reduced brightness.
5. Change the scheme
- For one graph, add
scheme(schemename)to the command. - For the session, run
set scheme schemename. - To make it persist across sessions, add
, permanently, for exampleset scheme economist, permanently. - To return to the factory default, run
set scheme default, permanently. - To get the pre-Stata 18 look, run
set scheme s2color, permanently, or addscheme(s2color)to a single command.
Output and how to read it
The result is the graph window, plus any file you export. Colors you see come from the scheme unless an option overrides them. A saved graph reopens in the scheme it was drawn with; graph use mygraph, scheme(economist) redisplays it in another scheme.
For print, the schemes documentation says white-background schemes are suitable for printing. Background areas can be changed with graphregion(fcolor()), graphregion(ifcolor()), plotregion(fcolor()) and plotregion(ifcolor()). Black-background schemes such as s1rcolor print in monochrome by default. If a journal supplies CMYK values, use the four-value form; when all four values are 1 or less they are treated as proportions of ink (red is “0 1 1 0”).
Troubleshooting
RGB, CMYK, HSV or hex values behave strangely
Enclose them in quotes. The manual’s advice is to type “128 128 128”, not 128 128 128.
Intensity has no effect
Write it with no space: green*.8, not green *.8.
Your graph does not match a tutorial
The tutorial was probably drawn with s2color, the factory setting before Stata 18. Switch with scheme(s2color) to reproduce it.
A monochrome scheme still needs colors
Monochrome schemes do not stop you specifying colors; options like mcolor() still apply.
Free alternatives
Stata ships with several schemes that change colors without any color options. These are the ones listed in the official schemes documentation:
| Scheme | What the manual says |
|---|---|
stcolor |
Factory setting; color, white background |
stmono1, stmono2 |
Monochrome |
stsj |
Official scheme for the Stata Journal |
s2color |
Factory setting prior to Stata 18 |
s2mono |
Monochrome |
s1rcolor |
Black background |
economist |
Economist style, with colors such as ebg, ebblue and edkblue |
Frequently asked questions
How do I change colors in Stata?
Add a color option with a colorstyle to the graph command, for example mcolor(navy), or change the scheme with set scheme.
What is the default color scheme in Stata?
stcolor, from Stata 18 onward. Before Stata 18 it was s2color.
How do I use a hex or RGB color in Stata?
Quote it: "#FF0000" for hex, "255 0 0" for RGB red.
How do I make Stata graph colors transparent?
Add %# from 0 to 100 to the colorstyle, for example green%50, or mcolor(%30) to change only the opacity of the default fill.
How do I list all Stata colors?
Run graph query colorstyle. Preview colors with palette color.
Sources (official docs)
- Stata manual [G-4] colorstyle, stata.com/manuals/g-4colorstyle.pdf, checked 2026-10-29.
- Stata manual [G-4] schemes intro, stata.com/manuals/g-4schemesintro.pdf, checked 2026-10-29.
- Stata 18 new graph style, stata.com/stata18/new-graph-style, checked 2026-10-29.
Related reading: labeling variables and values in Stata.







