Description Usage Arguments Examples
This allows you to specify you own set of mappings from levels in the data to aesthetic values that will repeat if a insufficient number of levels is provided.
1 2 3 4 5 6 7 8 9 10 11 12 13 | scale_fill_rep(..., values)
scale_alpha_rep(..., values)
scale_color_rep(..., values)
scale_colour_rep(..., values)
scale_linetype_rep(..., values)
scale_shape_rep(..., values)
scale_size_rep(..., values)
|
... |
Other arguments passed on to [discrete_scale()] to control name, limits, breaks, labels and so forth. |
values |
a set of aesthetic values to map data values to. If this is a named vector, then the values will be matched based on the names. If unnamed, values will be matched in order (usually alphabetical) with the limits of the scale. Will repeat if number of labels is less. |
1 2 3 4 5 6 7 | library(ggplot2)
dat <- data.frame(x = sample(LETTERS, 200, TRUE))
ggplot(dat, aes(x = x)) +
geom_bar(aes(fill = x)) +
scale_fill_rep(values = rainbow(5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.