Stata 15 help for set printcolor

[G-2] set printcolor -- Set how colors are treated when graphs are printed


query graphics

set printcolor {automatic | asis | gs1 | gs2 | gs3} [, permanently]

set copycolor {automatic | asis | gs1 | gs2 | gs3} [, permanently]


query graphics shows the graphics settings.

set printcolor determines how colors are handled when graphs are printed.

set copycolor (Mac and Windows only) determines how colors are handled when graphs are copied to the clipboard.


permanently specifies that, in addition to making the change right now, the setting be remembered and become the default setting when you invoke Stata.


printcolor and copycolor can be set one of five ways: automatic, asis, and gs1, gs2, or gs3. Four of the settings -- asis and gs1, gs2, and gs3 -- specify how colors should be rendered when graphs are printed or copied. The remaining setting -- automatic -- specifies that Stata determine by context whether asis or gs1 is used.

In the remarks below, copycolor can be used interchangeably with printcolor, the only difference being the ultimate destination of the graph.

Remarks are presented under the following headings:

What set printcolor affects The problem set printcolor solves set printcolor automatic set printcolor asis set printcolor gs1, gs2, and gs3 The scheme matters, not the background color you set

What set printcolor affects

set printcolor affects how graphs are printed when you select File > Print graph or when you use the graph print command; see [G-2] graph print.

set printcolor also affects the behavior of the graph export command when you use it to translate .gph files into another format such as PostScript; see [G-2] graph export.

We will refer to all the above in what follows as "printing graphs" or, equivalently, as "rendering graphs".

The problem set printcolor solves

If you should choose a scheme with a black background -- see [G-4] schemes intro -- and if you were then to print that graph, do you really want black ink poured onto the page so that what you get is exactly what you saw? Probably not. The purpose of set printcolor is to avoid such results.

set printcolor automatic

set printcolor's default setting -- automatic -- looks at the graph to be printed and determines whether it should be rendered exactly as you see it on the screen or if instead the colors should be reversed and the graph printed in a monochrome gray scale.

set printcolor automatic bases its decision on the background color used by the scheme. If it is white (or light), the graph is printed asis. If it is black (or dark), the graph is printed grayscale.

set printcolor asis

If you specify set printcolor asis, all graphs will be rendered just as you see them on the screen, regardless of the background color of the scheme.

set printcolor gs1, gs2, and gs3

If you specify set printcolor gs1, gs2, or gs3, all graphs will be rendered according to a gray scale. If the scheme sets a black or dark background, the gray scale will be reversed (black becomes white and white becomes black).

gs1, gs2, and gs3 vary how colors are mapped to grays. gs1 bases its mapping on the average RGB value, gs2 on "true grayscale", and gs3 on the maximum RGB value. In theory, true grayscale should work best, but we have found that average generally works better with Stata graphs.

The scheme matters, not the background color you set

In all the above, the background color you set using the region_options graphregion(fcolor()) and plotregion(fcolor()) plays no role in the decision that is made. Decisions are made based exclusively on whether the scheme naturally has a light or dark background.

You may set background colors but remember to start with the appropriate scheme. Set light background colors with light-background schemes and dark background colors with dark-background schemes.

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index