help for gpreset                                                 (Roger Newson)

Reset preferences for a custom graphics scheme to their original values

gpreset #

where # is a number from 1 to 3, specifying one of the customized graphics schemes custom1 to custom3.


gpreset resets the preferences for a specified customized graphics scheme to their original values as shipped with Stata. That is to say, custom1 is set to be the same as blackbg, custom2 is set to be the same as whitebg, and custom3 is set to be the same as monochrome. The user can therefore change the preferences of scheme custom# temporarily, and return them to their original values afterwards. For further details on graphics preference schemes, see help for gprefs.


Stata provides six graphics schemes, of which three (blackbg, whitebg and monochrome) are standard and cannot be modified by the user, and the other three (custom1, custom2 and custom3) are customizable and can be modified by the user. However, when shipped, custom1 is identical to blackbg, custom2 is identical to whitebg, and custom3 is identical to monochrome. This makes it easy for users to create customized schemes similar to one of the standard schemes, but different in a few details. gpreset allows the user to reset the customized settings in a single command. It is probably a good idea for the user to store frequently-used customized settings as sequences of gprefs commands in ado-files, which can convert the original values of the preferences of one of the customized schemes to the desired values. The user may also include one or more gpreset commands in the file profile.do, so that every Stata session starts with the customized schemes set to their original values; see help for profile.


The following example will reset the settings of the scheme custom3 to their original values, then set the thickness of pen 1 temporarily to 4, create a plot, and finally reset the settings back to their original values again.

. gpreset 3 . gprefs set custom3 pen1_thick 4 . gprefs query custom3 . gprefs set window scheme custom3 . gprefs set window update . grap mpg weight,s([foreign]) ylabel xlabel . gpreset 3 . gprefs query custom3


Roger Newson, King's College, London, UK. Email: roger.newson@kcl.ac.uk

Also see

Manual: [G] gprefs, [G] pens, [G] symbol On-line: help for gprefs, grsym, grcolor, graph