stata_shape_pal: Stata shape palette (discrete)

View source: R/stata.R

stata_shape_palR Documentation

Stata shape palette (discrete)

Description

Shape palette based on the symbol palette in Stata used in scheme s2mono. This palette supports up to 10 values.

Usage

stata_shape_pal(unicode = FALSE)

Arguments

unicode

If TRUE, return pch codes derived from Unicode glyphs, as this palette did before ggthemes 6.1.0. Glyph shapes are drawn by the device font, so they render as blank boxes in a font without coverage; the default returns base pch codes, which every font can draw.

Value

A palette function. It takes the number of shapes n and returns an integer vector of n shape (pch) codes, and can be used as the palette argument of discrete_scale().

Note

Stata's ten plotting symbols all have a base pch equivalent, so this palette supports ten values on either branch and nothing is dropped: solid and hollow circle, diamond, square and triangle, plus the X and the plus sign.

See Also

See scale_shape_stata() for examples.

Other shapes stata: scale_shape_stata()

Examples

stata_shape_pal()(10)

show_shapes(stata_shape_pal()(10))

ggthemes documentation built on Oct. 4, 2026, 1:06 a.m.