cleveland_shape_pal: Shape palette from Cleveland "Elements of Graphing Data"...

View source: R/shapes.R

cleveland_shape_palR Documentation

Shape palette from Cleveland "Elements of Graphing Data" (discrete).

Description

Shape palettes for overlapping and non-overlapping points.

Usage

cleveland_shape_pal(overlap = TRUE)

Arguments

overlap

logical Use the scale for overlapping points?

Note

In the Elements of Graphing Data, W.S. Cleveland suggests two shape palettes for scatter plots: one for overlapping data and another for non-overlapping data. The symbols for overlapping data relies on pattern discrimination, while the symbols for non-overlapping data vary the amount of fill. This palette attempts to create these palettes. However, I found that these were hard to replicate. Using the R shapes and unicode fonts: the symbols can vary in size, they are dependent of the fonts used, and there does not exist a unicode symbol for a circle with a vertical line. If someone can improve this palette, please let me know.

Following Tremmel (1995), this function replaces the circle with a vertical line with an encircled plus sign.

The palette cleveland_shape_pal() supports up to five values.

This package uses unicode symbols for the shapes. This means that it will not work for all graphics devices.

References

Cleveland WS. The Elements of Graphing Data. Revised Edition. Hobart Press, Summit, NJ, 1994, pp. 154-164, 234-239.

Tremmel, Lothar, (1995) "The Visual Separability of Plotting Symbols in Scatterplots", Journal of Computational and Graphical Statistics, https://www.jstor.org/stable/1390760

See Also

Other shapes: circlefill_shape_pal(), scale_shape_circlefill(), scale_shape_cleveland(), scale_shape_tremmel(), tremmel_shape_pal()

Examples

## Not run: 
library("ggplot2")
p <- ggplot(mtcars) +
     geom_point(aes(x = wt, y = mpg, shape = factor(gear))) +
     facet_wrap(~am) +
     theme_bw()
# overlapping symbol palette
p + scale_shape_cleveland()
# non-overlapping symbol palette
p + scale_shape_cleveland(overlap = FALSE)

## End(Not run)

ggthemes documentation built on Nov. 21, 2023, 5:08 p.m.