help linepalette                   


    linepalette -- Line pattern palettes


    Syntax 1: Retrieve (and display) a palette

        linepalette [palette] [, palette_options graph_options ]

    Syntax 2: Display multiple palettes

        linepalette [, palette_options graph_options ] : [ list_of_palettes ]

    where list_of_palettes is

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

    palette               Description
    Main (view)
      default             15 patterns as in Stata's monochrome schemes; the default
      pplain              15 patterns as in plotplain by Bischof (2017)

      patternlist         custom list of line patterns
      myname              custom palette provided by program linepalette_myname

    palette_options       Description
    n(#)                  specify size of palette (number of patterns)
    select(numlist)       select/order elements
    reverse               arrange palette in reverse order

    graph_options         Description
      title(str)          custom graph title
      lwidth(lwstyle)     line thickness
      gropts(options)     options to be passed through to the graph command

    Syntax 1 only
      rows(#)             minimum number of rows; default is 5
      nograph             do not generate a graph

    Syntax 2 only
      vertical            vertical plot; the default
      horizontal          horizontal plot
      plabels(strlist)    custom palette labels


    linepalette is a utility command to retrieve or display line pattern palettes.
    Palette entries are returned in r().

    linepalette is used by grstyle set.


    ----+ Palette options +----------------------------------------------------------

    n(#) specifies size of the palette (the number of elements). Typically this just
        selects the first # elements from the palette and is thus equivalent to

    select(numlist) selects and orders the elements retrieved from the palette.

    reverse returns the palette in reversed order.

    ----+ Graph options +------------------------------------------------------------

    title(str) specifies a custom title for the graph.

    lwidth(linewidthstyle) sets the line thickness. Default is lwidth(medthick).

    gropts(options) provides options to be passed through to the graph command.

    rows(#) specifies the minimum number of rows in the graph (syntax 1 only). The
        default is 5.

    nograph suppresses the graph (syntax 1 only).

    vertical displays the palettes vertically (syntax 2 only). This is the default.

    horizontal displays the palettes horizontally (syntax 2 only).

    plabels(strlist) provides custom labels for the palettes (syntax 2 only). Enclose
        labels with spaces in double quotes.


    ----+ default +------------------------------------------------------------------

    Palette default (view) contains the line patterns used for p1line to p15line or
    p1lineplot to p15lineplot in Stata's monochrome schemes. default is the default

    ----+ pplain +-------------------------------------------------------------------

    Palette pplain (view) contains the line patterns used for p1lineplot to
    p15lineplot in schemes plotplain and plotplainblind by Bischof (2017).

    ----+ patternlist +--------------------------------------------------------------

    Instead of using a named palette you can provide a custom palette by specifying a
    list of linepatternstyles. Example:

        . linepalette solid dash "--.." "--#"

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

    An own named palette can be provided in form of a program called
    linepalette_myname, where myname is the name of the palette. Palette myname will
    then be available to linepalette like any other palette. Your program should
    return the line pattern definitions as a comma-separated list in local macro P.
    In addition you may provide a comma-separated list of descriptions in local macro
    I. Example:

        program linepalette_morse
            c_local P .-###,-...###,-.-.###,-..###
            c_local I A,B,C,D

    After defining the program, you can, for example, type

        . linepalette morse

    to view the palette.


        . sysuse uslifeexp, clear
        . linepalette pplain, n(4) nograph
        . line le_wfemale le_wmale le_bfemale le_bmale year, lpattern(`r(p)')

Saved results

    linepalette stores the following in r() (Syntax 1 only):

      r(n)            number of returned palette entries

      r(ptype)        line
      r(pname)        name of palette
      r(pnote)        additional information on palette (if provided)
      r(p)            space separated list of palette entries
      r(p#)           #th palette entry
      r(p#info)       info of #th palette entry (if provided)


    Bischof, D. 2017. New graphic schemes for Stata: plotplain and plottig.  The
        Stata Journal 17(3): 748–759.


    Ben Jann, University of Bern,

    Thanks for citing this software as follows:

        Jann, B. (2017). palettes: Stata module providing color palettes, symbol
        palettes, and line pattern palettes. Available from

Also see

    Online:  help for colorpalette, symbolpalette, grstyle set, graph,