help grstyle set                               http://repec.sowi.unibe.ch/stata/grstyle
                                                     http://github.com/benjann/grstyle/
---------------------------------------------------------------------------------------

Title

    grstyle set -- Utility command to generate graph settings for grstyle


Syntax

        grstyle set subcmd ...

    subcmd                            Description
    ---------------------------------------------------------------------------------
    Background and coordinate system
      plain [, options]               plain overall look (no background shading etc.)
      mesh [, options]                plain look; mesh of grid lines without axes
      imesh [, options]               plain look; inverted mesh (similar to ggplot2
                                        in R)
      horizontal                      horizontal tick labels on y axis
      compact                         smaller fonts, margin, and symbols
      grid [, options]                turn all grid lines on
      nogrid                          turn grid lines off
      noextend                        do not extend axis lines

    Legend
      legend [#] [, options]          placement and look of legend

    CIs
      ci [colors] [, options]         transparent confidence intervals

    Colors, symbols, line patterns
      color [palette] [, options]     assign colors
      intensity [intlist] [, options] assign color intensities
      symbol [palette] [, options]    assign markers symbols
      lpattern [palette] [, options]  assign line patterns

    Sizes
      graphsize [height [width]]      set graph size
      size sizelist [, options]       set text and gap sizes
      symbolsize sizelist [, options] set symbol sizes
      linewidth sizelist [, options]  set line widths
      margin sizelist [, options]     set margin widths

    Custom
      myname ...                      custom subcommand provided by program
                                        grstyle_set_myname; see below
    ---------------------------------------------------------------------------------


Description

    grstyle set adds precoded collections of scheme entries to the style settings
    maintained by grstyle and provides tools for automizing the generation of scheme
    entries for certain attributes such as colors or sizes.


Subcommands

        +-------+
    ----+ plain +--------------------------------------------------------------------

        grstyle set plain [, horizontal compact [no]grid minor dotted noextend box ]

    Apply a plain overall look: white background; no shading of by-labels and matrix
    labels; black title; grid lines in gray. Options are as follows:

    horizontal sets the orientation of tick labels on the y axis to horizontal; same
        as grstyle set horizontal.

    compact reduces the symbols size, some font sizes, and the graph margin; same as
        grstyle set compact.

    grid turns all grid lines on (horizontal, vertical, minimum, maximum); same as
        grstyle set grid.

    nogrid turns grid lines off; same as grstyle set nogrid.

    minor adds a minor grid (one minor grid line between each pair of major grid
        lines). minor only has an effect if grid is specified.

    dotted requests dotted grid lines.

    noextend draws axis lines only to the smallest and largest tick marks; same as
        grstyle set noextend.

    box draws a frame around the plot region. The default is to omit the frame.

    Examples:

        . grstyle init
        . grstyle set plain, horizontal grid
        . sysuse auto, clear
        . scatter price mpg, by(foreign)

        . grstyle init
        . grstyle set plain, horizontal grid dotted
        . scatter price mpg

        . grstyle init
        . grstyle set plain, nogrid noextend
        . scatter price mpg

        +------+
    ----+ mesh +---------------------------------------------------------------------

        grstyle set mesh [, minor horizontal compact ]

    Similar to plain, but the coordinate plane is a mesh of grid lines; axis lines
    and ticks are omitted; grid lines and tick labels are in gray. Options are as
    follows:

    minor adds a minor grid (one minor grid line between each pair of major grid
        lines).

    horizontal sets the orientation of tick labels on the y axis to horizontal; same
        as grstyle set horizontal.

    compact reduces the symbols size, some font sizes, and the graph margin; same as
        grstyle set compact.

    Examples:

        . grstyle init
        . grstyle set mesh, horizontal compact
        . sysuse auto, clear
        . scatter price mpg

        . grstyle init
        . grstyle set mesh, nominor horizontal
        . scatter price mpg

        +-------+
    ----+ imesh +--------------------------------------------------------------------

        grstyle set imesh [, minor horizontal compact ]

    Similar to plain, but the coordinate plane is an inverted mesh: gray background
    with white grid lines; axis lines are omitted. The look is similar to ggplot2 in
    R. Options are as follows:

    minor adds a minor grid (one minor grid line between each pair of major grid
        ines).

    horizontal sets the orientation of tick labels on the y axis to horizontal; same
        as grstyle set horizontal.

    compact reduces the symbols size, some font sizes, and the graph margin; same as
        grstyle set compact.

    Examples:

        . grstyle init
        . grstyle set imesh, horizontal compact
        . sysuse auto, clear
        . scatter price mpg

        . grstyle init
        . grstyle set imesh, nominor horizontal
        . scatter price mpg

        +------------+
    ----+ horizontal +---------------------------------------------------------------

        grstyle set horizontal

    Set the orientation of tick labels on the y axis to horizontal. Example:

        . grstyle init
        . grstyle set horizontal
        . sysuse auto, clear
        . scatter price mpg

        +---------+
    ----+ compact +------------------------------------------------------------------

        grstyle set compact

    Reduce the symbols size, some font sizes, and the graph margin. Example:

        . grstyle init
        . grstyle set compact
        . sysuse auto, clear
        . scatter price mpg

        +------+
    ----+ grid +---------------------------------------------------------------------

        grstyle set grid [, minor ]

    Turn all grid lines on (horizontal, vertical, minimum, maximum). Option minor
    adds an additional minor grid (one minor grid line between each pair of major
    grid lines). Example:

        . grstyle init
        . grstyle set grid
        . sysuse auto, clear
        . scatter price mpg

        +--------+
    ----+ nogrid +-------------------------------------------------------------------

        grstyle set nogrid

    Turn grid lines off. Example:

        . grstyle init
        . grstyle set nogrid
        . sysuse auto, clear
        . scatter price mpg

        +----------+
    ----+ noextend +-----------------------------------------------------------------

        grstyle set noextend

    Draw axis lines only to the smallest and largest tick marks (i.e. do not extend
    axis lines to the bounding box of the plot region). Example:

        . grstyle init
        . grstyle set noextend
        . sysuse auto, clear
        . scatter price mpg

        +--------+
    ----+ legend +-------------------------------------------------------------------

        grstyle set legend [clockposstyle] [, nobox stacked inside klength(
               textsizestyle) ]

    Determine placement and formatting of legend. clockposstyle sets the position of
    the legend; default is 6 (at the bottom). For example, type grstyle set legend 4
    to place the legend at the lower right side of the plot. If the legend is placed
    at the side (clockposstyle between 2 and 4 or between 7 and 9), the number of
    legend columns will be restricted to 1. Options are as follows:

    nobox removes the box around the legend (including background color).

    stacked stacks keys and labels (and makes some adjustments to the gaps between
        keys).

    inside places the legend inside the plot region.

    klength(textsizestyle) changes the length of legend keys. The default is
        klength(huge). This is considerably shorter than the factory setting, which
        is equivalent to klength(13).

    Examples:

        . grstyle init
        . grstyle set legend 2, inside
        . sysuse auto, clear
        . two (scatter price mpg if foreign) (scatter price mpg if !foreign)

        . grstyle init
        . grstyle set imesh, horizontal compact
        . grstyle set legend 4, nobox
        . two (scatter price mpg if foreign) (scatter price mpg if !foreign)

        +----+
    ----+ ci +-----------------------------------------------------------------------

        grstyle set ci [colors] [, opacity(numlist) palette_options ]

    Make shading of confidence intervals transparent (Stata 15 required).  colors is
    a list of colors as described in Specifying colors below or a color palette
    provided by colorpalette. If one color is specified, only ci is set; if more than
    one color is specified, ci and ci2 are set (using the first two colors). If no
    colors are specified, ci is set to gs12 and ci2 is set to ltkhaki (same as in the
    s2color scheme). Options are as follows:

    opacity(numlist) sets the level of opacity (0: fully transparent, 100: fully
        opaque). The default is opacity(50). Specify two values if you want to use
        different opacity levels for ci and ci2.

    palette_options are palette options such as n() to set the palette size, select()
        to select elements from a palette, reverse to use the palette in reverse
        order, or intensity() to apply color intensity adjustment. See colorpalette
        for details.

    Example:

        . grstyle init
        . grstyle set ci /* requires Stata 15 */
        . sysuse auto, clear
        . two (scatter price length) (lpolyci price length if foreign==0) (lpolyci
          price length if foreign==1, astyle(ci2)), legend(off)

        . grstyle init
        . grstyle set ci burd, select(11 13) /* requires Stata 15 */
        . two (scatter price length) (lpolyci price length if foreign==0) (lpolyci
          price length if foreign==1, astyle(ci2)), legend(off)

        +-------+
    ----+ color +--------------------------------------------------------------------

        grstyle set color [argument] [, plots(numlist) palette_options ] [ : elements
               ]

    where argument is

        palette [[, palette_options] / [ palette [, palette_options] / ... ]]

    Assign colors (using the color scheme entry attribute). palette is a color
    palette provided by colorpalette (or by colorpalette9 if using a Stata version
    older than 14.2) or list of colors as described in Specifying colors below. The
    default palette uses the same colors as in Stata's s2color scheme. Options are as
    follows:

    plots(numlist) specifies the plot numbers for numbered elements.

    palette_options are palette options such as n() to set the palette size, select()
        to select elements from a palette, reverse to use the palette in reverse
        order, intensity() to apply color intensity adjustment, or opacity() to set
        opacity. See colorpalette for details.

    elements is a space-separated list of scheme entry elements to be set (see scheme
    entries). The default is p#. Some possible elements are:

        Numbered elements    
          p#                 default plot colors
          p#markfill         marker fill colors
          p#markline         marker outline colors
          p#label            marker label colors
          p#lineplot         line colors for line plots
          p#line             line colors for connected-line plots
          p#area             fill colors for area plots
          p#arealine         outline colors for area plots
          p#bar              fill colors for bar plots
          p#barline          outline colors for bar plots
          p#box              fill colors for box plots
          p#boxline          outline/whisker colors for box plots
          p#boxmarkfill      marker fill colors for box plots
          p#boxmarkline      marker outline colors for box plots
          p#boxlabel         marker label colors for box plots
          p#dotmarkfill      fill colors for dot plots
          p#dotmarkline      outline colors for dot plots
          p#pie              slice colors for pie plots

        Other plot elements  
          histogram          histogram-bar fill color
          histogram_line     histogram-bar outline color
          sunflower          sunflower marker color
          sunflowerlb        light sunflower background color
          sunflowerdb        dark sunflower background color
          sunflowerlf        light sunflower line color
          sunflowerdf        dark sunflower line color
          matrix             marker fill color for graph matrix
          matrixmarkline     marker outline color for graph matrix
          contour_begin      starting color for contour plots
          contour_end        ending color for contour plots
          ci_area            fill color for ci
          ci_arealine        outline color for ci
          ci2_area           fill color for ci2
          ci2_arealine       outline color for ci2
          refline            reference-line color
          refmarker          reference-marker fill color
          refmarkline        reference-marker outline color

        General elements     
          background         background color
          plotregion         plot region fill color
          plotregion_line    plot region outline color
          major_grid         color for grid lines
          legend             legend fill color
          legend_line        legend outline color
          xyline             added line color

    Examples:

        . grstyle init
        . grstyle set legend 2, nobox
        . grstyle set color economist
        . sysuse nlsw88, clear
        . graph bar wage if occ<9, over(occ) asyvars over(union)

        . grstyle set color ptol rainbow, n(8) reverse
        . graph bar wage if occ<9, over(occ) asyvars over(union)

        . grstyle set color Greens, n(8)
        . graph bar wage if occ<9, over(occ) asyvars over(union)

        . // Transparent markers without outline (using default palette):
        . grstyle init
        . grstyle set color, opacity(60): p#markfill
        . grstyle set color, opacity(0): p#markline
        . sysuse auto, clear
        . two (scatter price length if foreign) (scatter price length if !foreign)

        . // Layout and colors similar to ggplot2:
        . grstyle init
        . grstyle set imesh, horizontal compact
        . grstyle set legend 4, nobox
        . grstyle set color hue, n(5)
        . sysuse auto, clear
        . separate price, by(rep) shortlabel
        . scatter price? weight, ytitle(Price)

        +-----------+
    ----+ intensity +----------------------------------------------------------------

        grstyle set intensity [intlist] [, plots(numlist) ] [ : elements ]

    Assign color intensities (using the intensity scheme entry attribute). intlist is
    a space-separated list of intensity specifications according to intensitystyle.
    The default is 100. Options are as follows:

    plots(numlist) specifies the plot numbers for numbered elements.

    elements is a space-separated list of scheme entry elements to be set (see scheme
    entries). The default is p if intlist only contains a single element and plots()
    is omitted. Otherwise, the default is p#. Some possible elements are:

        Numbered elements    
          p#                 fill intensities for bars and areas in twoway graphs
          p#area             fill intensities for areas in twoway graphs
          p#bar              fill intensities for bars in twoway graphs

        Other elements       
          bar                fill intensity for graph bar
          bar_line           outline intensity for graph bar
          box                fill intensity for graph box
          box_line           outline intensity for graph box
          pie                fill intensity for graph pie
          histogram          fill intensity for histograms
          sunflower          fill intensity for sunflower plots
          ci_area            fill intensity for ci and ci2

    Example:

        . grstyle init
        . grstyle set inten 20: bar
        . sysuse citytemp, clear
        . graph bar (mean) tempjuly tempjan, over(region) bargap(-30)

        +--------+
    ----+ symbol +-------------------------------------------------------------------

        grstyle set symbol [palette] [, plots(numlist) palette_options ] [ : elements
               ]

    Assign marker symbols (using the symbol scheme entry attribute). palette is a
    symbol palette provided by symbolpalette or a list of symbols according to 
    symbolstyle. The default palette uses the same symbols as official Stata's
    monochrome schemes.  Options are as follows:

    plots(numlist) specifies the plot numbers for numbered elements.

    palette_options are palette options such as n() to set the palette size, select()
        to select elements from a palette, or reverse to use the palette in reverse
        order. See symbolpalette for details.

    elements is a space-separated list of scheme entry elements to be set (see scheme
    entries). The default is p if palette only contains a single element and plots()
    is omitted. Otherwise, the default is p#. Some possible elements are:

        Numbered elements    
          p#                 marker symbols for all plot types; the default
          p#box              symbol of outside value markers for box plots
          p#dot              marker symbols for dot plots

        Other elements       
          matrix             marker symbol for graph matrix
          sunflower          marker symbol for sunflower
          refmarker          reference-marker symbol

    Example:

        . grstyle init
        . grstyle set symbol tufte
        . sysuse auto, clear
        . separate price, by(rep) shortlabel
        . scatter price? weight, ytitle(Price)

    Since Stata 15 it is possible to specify angles for marker symbols. Corresponding
    scheme entries can be constructed as anglestyle p#symbol anglestyle. Example:

        . grstyle init
        . grstyle set symbol T T
        . grstyle anglestyle p2symbol 180
        . sysuse auto, clear
        . separate price, by(foreign)
        . scatter price? weight, ytitle(Price)

        +----------+
    ----+ lpattern +-----------------------------------------------------------------

        grstyle set lpattern [palette] [, plots(numlist) palette_options ] [ :
               elements ]

    Assign line patterns (using the linepattern scheme entry attribute). palette is a
    line pattern palette provided by linepalette or a list of patterns according to 
    linepatternstyle. The default palette uses the same line patterns as official
    Stata's monochrome schemes. Options are as follows:

    plots(numlist) specifies the plot numbers for numbered elements.

    palette_options are palette options such as n() to set the palette size, select()
        to select elements from a palette, or reverse to use the palette in reverse
        order. See linepalette for details.

    elements is a space-separated list of scheme entry elements to be set (see scheme
    entries). The default is p if palette only contains a single element and plots()
    is omitted. Otherwise, the default is p#. Some possible elements are:


        Numbered elements    
          p#                 line patterns for all plot types; the default
          p#lineplot         line patterns for line plots
          p#line             line patterns for connected-line plots

        Other elements       
          major_grid         line pattern for grid lines
          xyline             line pattern for added lines
          refline            line pattern for reference lines
          ci_area            line pattern for confidence intervals

    Example:

        . grstyle init
        . grstyle linewidth plineplot medthick
        . grstyle set lpattern
        . sysuse uslifeexp, clear
        . line le_wfemale le_wmale le_bfemale le_bmale year

        +-----------+
    ----+ graphsize +----------------------------------------------------------------

        grstyle set graphsize [height [width]]

    Set the size of the graph. Units for height and width may be inch (inches; the
    default), pt (points; 1 inch = 72 points), cm (centimeters; 1 inch = 2.54
    centimeters), or mm (millimeters; 1 inch = 25.4 millimeters). The default height
    is 4 inches, the default width is 5.5 inches.

    Examples:

        . grstyle init
        . grstyle set graphsize 4 3
        . sysuse auto, clear
        . scatter price weight

        . grstyle init
        . grstyle set graphsize 10cm 12cm
        . sysuse auto, clear
        . scatter price weight

    Apart from creating scheme entries for the graph size, grstyle set graphsize
    stores the reference size for translations of absolute sizes to relative sizes in
    global macro GRSTYLE_RSIZE (the reference size is the minimum of height and width
    of the graph in inches). This information will be used by grstyle set size,
    grstyle set symbolsize, grstyle set linewidth, and grstyle set margin.

        +------+
    ----+ size +---------------------------------------------------------------------

        grstyle set size sizelist [, pt mm inch cm plots(numlist) ] [ : elements ]

    Set size of text objects and gaps (using the gsize scheme entry attribute).
    sizelist is a space-separated list of absolute sizes (pt, mm, inch, or cm; see
    Setting absolute sizes below) or size specifications according to textsizestyle
    (excluding multiplication syntax). Options are as follows:

    pt, mm, inch, and cm determine how numbers without units in sizelist will be
        interpreted. The default is to interpret them as relative sizes and pass them
        through to the scheme file as is.  Alternatively, specify pt, mm, inch, or cm
        to interpret them as absolute sizes.

    plots(numlist) specifies the plot numbers for numbered elements.

    elements is a space-separated list of scheme entry elements to be set (see scheme
    entries). Some possible elements are:

        Numbered elements    
          p#label            text size of marker labels for all plot types
          p#boxlabel         text size of labels on outside value markers for box
                               plots

        Other plot elements  
          label_gap          distance between markers and their labels
          pielabel_gap       distance of pie labels from center of pie
          pie_explode        distance to explode pie slices
          barlabel_gap       added distance between bars and their labels for graph
                               bar
          matrix_label       size of diagonal titles for graph matrix
          matrix_marklbl     size of marker labels for graph matrix
          matrix_mlblgap     gap between marker and label for graph matrix

        General elements     
          heading            size of title
          subheading         size of subtitle
          body               size of caption
          small_body         size of note
          text_option        size of added text
          axis_title         size of axis titles
          axis_title_gap     gap between tick labels and axis titles
          tick_label         size of major tick labels
          tick               length of major ticks
          minortick_label    size of minor tick labels
          minortick          length of minor ticks
          tickgap            gap between ticks and labels
          key_label          size of labels in legend
          legend_row_gap     gap between legend rows
          legend_col_gap     gap between legend columns
          legend_key_gap     gap between key and label in legend
          legend_key_xsize   length of keys
          legend_key_ysize   height of keys

    Example:

        . grstyle init
        . grstyle set graphsize 7cm 9cm
        . grstyle set size 10pt: heading
        . grstyle set size 8pt: subheading axis_title
        . sysuse auto, clear
        . scatter price weight, title("Title (10pt)") subtitle("Subtitle (8pt)")
          xtitle("X axis title (8pt)") ytitle("Y axis title (8pt)")

        +------------+
    ----+ symbolsize +---------------------------------------------------------------

        grstyle set symbolsize sizelist [, pt mm inch cm plots(numlist) ] [ :
               elements ]

    Set size of symbols (using the symbolsize scheme entry attribute). sizelist is a
    space-separated list of absolute sizes (pt, mm, inch, or cm; see Setting absolute
    sizes below) or size specifications according to markersizestyle (excluding
    multiplication syntax). Options are as follows:

    pt, mm, inch, and cm determine how numbers without units in sizelist will be
        interpreted. The default is to interpret them as relative sizes and pass them
        through to the scheme file as is.  Alternatively, specify pt, mm, inch, or cm
        to interpret them as absolute sizes.

    plots(numlist) specifies the plot numbers for numbered elements.

    elements is a space-separated list of scheme entry elements to be set (see scheme
    entries). The default is p if sizelist only contains a single element and plots()
    is omitted. Otherwise, the default is p#. Some possible elements are:

        Numbered elements    
          p#                 size of marker symbols for all plot types
          p#box              size of outside value markers for box plots
          p#dot              size of marker symbols for dot plots

        Other elements       
          matrix             size of marker symbol for graph matrix
          sunflower          size of marker symbol for sunflower
          refmarker          size of reference-marker symbol

    Example:

        . grstyle init
        . grstyle set legend 2
        . grstyle set graphsize 7cm 9cm
        . grstyle set symbolsize 1 2 3 4 5, pt: p#
        . sysuse auto, clear
        . separate price, by(rep) shortlabel
        . scatter price? weight, ytitle(Price)

        +-----------+
    ----+ linewidth +----------------------------------------------------------------

        grstyle set linewidth sizelist [, pt mm inch cm plots(numlist) ] [ : elements
               ]

    Set width of lines (using the linewidth scheme entry attribute).  sizelist is a
    space-separated list of absolute sizes (pt, mm, inch, or cm; see Setting absolute
    sizes below) or size specifications according to linewidthstyle (excluding
    multiplication syntax). Options are as follows:

    pt, mm, inch, and cm determine how numbers without units in sizelist will be
        interpreted. The default is to interpret them as relative sizes and pass them
        through to the scheme file as is.  Alternatively, specify pt, mm, inch, or cm
        to interpret them as absolute sizes.

    plots(numlist) specifies the plot numbers for numbered elements.

    elements is a space-separated list of scheme entry elements to be set (see scheme
    entries). The default is p if sizelist only contains a single element and plots()
    is omitted. Otherwise, the default is p#. Some possible elements are:

        Numbered elements    
          p#                 line thickness for all plot types
          p#mark             outline thickness of markers
          p#lineplot         line thickness for line plots
          p#area             outline thickness for area plots
          p#bar              outline thickness for bar plots
          p#box              outline thickness for box plots
          p#boxmark          outline thickness of outside value markers in box plots
          p#dotmark          marker outline thickness for dot plots

        Other plot elements  
          pie                outline thickness of pie slices
          histogram          histogram bar outline thickness
          sunflower          sunflower petal thickness
          matrixmark         marker outline thickness for graph matrix
          ci_area            line thickness for ci
          ci2_area           line thickness for ci2
          refline            reference-line thickness
          refmarker          reference-marker outline thickness

        General elements     
          plotregion         thickness of plot region outline, if drawn
          matrix_plotregion  plotregion outline thickness for graph matrix
          axisline           thickness of axis lines
          major_grid         thickness of grid lines
          tick               line thickness of major ticks
          minortick          line thickness of minor ticks
          legend             legend outline thickness, if drawn
          xyline             thickness added lines
          text_option        thickness box outline of added text, if drawn

    Example:

        . grstyle init
        . grstyle set graphsize 4 5.5
        . grstyle set linewidth 2pt: axisline tick major_grid legend xyline
        . grstyle set linewidth 4pt: plineplot
        . sysuse auto, clear
        . two (scatter price weight) (lpoly price weight), xline(4000)

        +--------+
    ----+ margin +-------------------------------------------------------------------

        grstyle set margin sizelist [, pt mm inch cm plots(numlist) ] [ : elements ]

    Set size of margins (using the margin scheme entry attribute). sizelist is a
    space-separated list of absolute sizes (pt, mm, inch, or cm; see Setting absolute
    sizes below) or size specifications according to marginstyle (excluding
    marginexp). A numeric element in sizelist can be a single number, in which case
    the same margin will be used on all four sides, or a set of numbers enclosed in
    double quotes according to the following order:

        "left right bottom top"

    For example, type "5pt 2pt 0pt 10pt" to use 5 points on the left, 2 points on the
    right, zero points at the bottom, and 10 points at the top.  If the set contains
    less than four numbers, the last number will be repeated. For example, "5pt 2pt"
    will be interpreted as "5pt 2pt 2pt 2pt". Options are as follows:

    pt, mm, inch, and cm determine how numbers without units in sizelist will be
        interpreted. The default is to interpret them as relative sizes and pass them
        through to the scheme file as is.  Alternatively, specify pt, mm, inch, or cm
        to interpret them as absolute sizes.

    plots(numlist) specifies the plot numbers for numbered elements.

    elements is a space-separated list of scheme entry elements to be set (see scheme
    entries). The default is graph. Some possible elements are:

        graph                margin around graph; the default
        twoway               plot region margin for twoway graphs
        bygraph              margin around combined subgraphs for by()
        by_indiv             margin around individual subgraphs for by()
        combinegraph         margin around combined graphs for graph combine
        heading              margin around title
        subheading           margin around subtitle
        body                 margin around caption
        small_body           margin around note
        axis_title           margin around axis titles
        legend               margin around legend: inside the legend box
        legend_boxmargin     margin around legend: outside the legend box
        text_option          margin around added text, if box is drawn

    Example:

        . grstyle init
        . grstyle set graphsize 4 5.5
        . grstyle set margin "5pt 15pt 5pt 5pt": graph
        . sysuse auto, clear
        . scatter price weight, title(Scatterplot)

        +--------+
    ----+ myname +-------------------------------------------------------------------

    A personal collection of graph settings can be provided by defining a program
    called grstyle_set_myname. myname will then be available to grstyle set like any
    other subcommand.

    When calling your program, grstyle set provides global macro GRSTYLE_FH
    containing the file handle of the scheme file to be written to. Use file write
    with this handle to add your scheme entries. For example, the following program
    would set the default approximate number of labeled ticks to 10 (and print
    y-labels horizontally):

        program grstyle_set_myticks
            file write $GRSTYLE_FH "numticks_g horizontal_major 10" _n
            file write $GRSTYLE_FH "numticks_g vertical_major   10" _n
            file write $GRSTYLE_FH "anglestyle vertical_tick horizontal" _n
        end

    After defining the program (or storing the program in file
    grstyle_set_myticks.ado), it can be used as follows:

        . grstyle init
        . grstyle set myticks
        . sysuse auto
        . scatter price weight

    Your program can also have options. Here is an extended example with an option
    for the approximate number of labeled ticks and an additional option to set the
    number of unlabeled minor ticks between the labeled ticks:

        program grstyle_set_myticks
            syntax [, n(int 5) mticks(int 0) ]
            file write $GRSTYLE_FH "numticks_g horizontal_major `n'" _n
            file write $GRSTYLE_FH "numticks_g vertical_major   `n'" _n
            file write $GRSTYLE_FH "anglestyle vertical_tick horizontal" _n
            file write $GRSTYLE_FH "numticks_g horizontal_tminor `mticks'" _n
            file write $GRSTYLE_FH "numticks_g vertical_tminor   `mticks'" _n
        end

    You could then type

        . grstyle init
        . grstyle set myticks, n(10) mticks(5)
        . sysuse auto
        . scatter price weight


Remarks

        +-------------------+
    ----+ Specifying colors +--------------------------------------------------------

    When providing a list of colors to grstyle set color or grstyle set ci, use color
    specifications according to colorstyle (named colors; RBG colors specified as "#
    # #"; CMYK colors specified as "# # # #"; or HSV colors specified as "hsv # #
    #"). Example:

        . grstyle set color cranberry dkgreen gold navy

    Same colors using RGB codes:

        . grstyle set color "193 5 52" "0 96 0" "255 210 0" "26 71 111"

    It is also possible to specify RGB colors using their 6-digit hex codes (or
    3-digit abbreviations; see en.wikipedia.org/wiki/Web_colors for background
    information; some websites providing collections of colors are
    www.w3schools.com/colors, htmlcolorcodes.com, or www.color-hex.com). Start the
    color specification with a hash in this case. The hex codes will be translated to
    RGB. Example:

        . grstyle set color #30C #11eedd #FFC0CB #f1e2ab

    Furthermore, HCL colors can be provided as "hcl # # #", where the first number
    specifies the hue (dominant wavelength in degrees of the 360 degree color wheel),
    the second number specifies the chroma (colorfulness, color intensity; # >= 0)
    and the third number specifies the luminance (brightness, amount of gray; # in
    [0, 100]). HCL colors will be translated to RGB. Example:

        . grstyle set color "hcl 0 100 70" "hcl 120 100 70" "hcl 240 100 70"

    If using Stata 14.2 or newer, many more input formats are supported, including
    named web colors and color values in various color spaces. See colorpalette for
    details.

    Color intensity adjustment may be requested by adding adjustment factor *# to a
    color. Example (original navy and navy with 70% intensity in 3 different ways):

        . grstyle set color navy navy*.7 "26 71 111*.7" #1a476f*.7

    Furthermore, since Stata 15, colors may be complemented by opacity specified as
    %#. Example (original navy and navy with 80% opacity in 3 different ways):

        . grstyle set color navy navy%80 "26 71 111%80" #1a476f%80

    Intensity and opacity can be combined:

        . grstyle set color navy navy*.7 navy%80 navy*.7%80

        +--------------------------------+
    ----+ Numbered scheme entry elements +-------------------------------------------

    Some of the above commands support the specification of numbered scheme entry
    elements using shorthand notation p#[stub]. Examples are p#, p#line, or p#label.
    Such syntax will be expanded to a set of numbered elements (p1stub, p2stub, etc.)
    using the numbers provided by the plots() option or, if plots() is omitted, using
    numbers 1 to n, where n is the number of attribute values (colors, line patterns,
    sizes, etc.) provided to the command. The values will be assigned one by one to
    the expanded elements (recycling the list of attribute values if necessary). Each
    set is treated separately, that is, assignment of attribute values starts over
    with the first value for each set.

    Of course, you can also specify numbered elements directly as p1stub, p2stub,
    etc. They will then be treated like any other (unnumbered) element. All specified
    elements that do not use the above shorthand notation are taken together as an
    additional set of elements. That is, attribute values will be assigned one by
    one, in the order in which the elements have been specified, starting with the
    first value in the provided list of attribute values.

    Finally, note that numbered elements always also have an unnumbered form,
    p[stub], that can be used to set the default for all plots. For example, to use
    the same style for marker labels in all plots you can simply set plabel instead
    of p1label, p2label, etc.  However, note that numbered elements will take
    precedence over unnumbered elements. That is, if, say, p3label has been set,
    setting plabel will have no effect on marker labels in the 3rd plot.

        +------------------------+
    ----+ Setting absolute sizes +---------------------------------------------------

    Commands grstyle set size, grstyle set symbolsize, grstyle set linewidth, and
    grstyle set margin allow the specification of absolute sizes as #pt (# points; 1
    inch = 72 points), #mm (# millimeters; 1 inch = 25.4 millimeters), #inch (#
    inches), or #cm (# centimeters; 1 inch = 2.54 centimeters).

    Absolute sizes are specific to the chosen graph size. They are translated to
    relative sizes based on the reference size set by grstyle set graphsize (or a
    reference size of 4 inches if the graph size has not been set). Since absolute
    sizes are implemented in terms of relative sizes with respect to a particular
    graph size, the requested absolute sizes will only be preserved as long as the
    graph size (or the minimum of height and width of the graph, to be precise) does
    not change.


Author

    Ben Jann, University of Bern, ben.jann@soz.unibe.ch

    Thanks for citing this software as

        Jann, B. (2018a). Customizing Stata graphs made easy (part 1). The Stata
        Journal 18(3): 491-502.
        Jann, B. (2018b). Customizing Stata graphs made easy (part 2). The Stata
        Journal 18(4): 786–802.

    or

        Jann, B. (2017). grstyle: Stata module to customize the overall look of
        graphs. Available from http://ideas.repec.org/c/boc/bocode/s458414.html.


Also see

    Online:  help for grstyle, colorpalette, colorpalette9, symbolpalette, 
             linepalette, graph, schemes, scheme files, scheme entries