help linepalette                             http://repec.sowi.unibe.ch/stata/palettes/
---------------------------------------------------------------------------------------

Title

    linepalette -- Line pattern palettes


Syntax

    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)

    Custom
      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
    ---------------------------------------------------------------------------------
    Main
      title(string)       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
    ---------------------------------------------------------------------------------


Description

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

    linepalette is used by grstyle set.


Options

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

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

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

    reverse returns the palette in reversed order.

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

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

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

    gropts(twoway_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.

Palettes

        +---------+
    ----+ 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
    palette.

        +--------+
    ----+ 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
        end

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

        . linepalette morse

    to view the palette.


Example

        . 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):

    Scalars    
      r(n)            number of returned palette entries

    Macros     
      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)


References

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


Author

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

    Thanks for citing this software as follows:

        Jann, B. (2017). palettes: Stata module providing color palettes, symbol
        palettes, and line pattern palettes. Available from 
        http://ideas.repec.org/c/boc/bocode/s458444.html.


Also see

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