Description Usage Arguments Details Author(s) Examples
Gives a random colour from ggthemr swatch. This might be useful if you are producing lots of plots with one colour, which can get a bit boring to look at. You can use this function to get a random colour for each of your plots to make them more interesting.
1 | random_swatch_colour(limit = 4L)
|
limit |
How many colours from the swatch should be considered for sampling (see details). |
The first colour of the swatch will never be returned as this is a special value. The first few colours are usually "better" as they are well suited to the theme and have good contrast with each other. The random colour is therefore limited by default to the first few colours.
Ciaran Tobin
1 2 3 4 5 6 7 | ggthemr('dust')
ggplot(diamonds, aes(carat, price)) +
geom_point(colour = random_swatch_colour())
colorem <- random_swatch_colour()
ggplot(diamonds, aes(color, price)) +
geom_boxplot(fill = colorem, outlier.colour = colorem)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.