Description Usage Arguments Aesthetics Computed variables Author(s) Examples
This geom allows you to draw the star curve.
1 2 3 4 5 6 7 | stat_star(mapping = NULL, data = NULL, geom = "star",
position = "identity", n_points = 360, na.rm = FALSE,
show.legend = NA, inherit.aes = TRUE, ...)
geom_star(mapping = NULL, data = NULL, stat = "star",
position = "identity", n_points = 360, na.rm = FALSE,
show.legend = NA, inherit.aes = TRUE, ...)
|
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
geom |
The geometric object to use display the data |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
n_points |
The number of points to sample along the curve. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
Other arguments passed on to |
stat |
The statistical transformation to use on the data for this layer, as a string. |
geom_arc understand the following aesthetics (required aesthetics are in bold):
- **n_tips** - r_min - r_max - offset - x0 - y0 - xscale - yscale - rotation - color - fill - size - linetype - alpha - lineend
The coordinates for the points along the star curve
Emil Hvitfeldt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | # Changing number of tips
ggplot() +
geom_star(aes(n_tips = 5))
ggplot() +
geom_star(aes(n_tips = 11))
# changing radei
ggplot() +
geom_star(aes(r_min = 0.2, r_max = 1, n_tips = 5))
ggplot() +
geom_star(aes(r_min = 0.7, r_max = 1, n_tips = 5))
# rescaling
ggplot() +
geom_star(aes( n_tips = 5, xscale = 4, yscale = 2))
# Rotation
ggplot() +
geom_star(aes(n_tips = 5, rotation = pi / 4))
# Playing witn offset parameter
ggplot() +
geom_star(aes(n_tips = 5, offset = 0))
ggplot() +
geom_star(aes(n_tips = 5, offset = 1))
ggplot() +
geom_star(aes(n_tips = 11, offset = 5))
# Multiple stars
ggplot() +
geom_star(aes(n_tips = c(3, 5, 7),
x0 = c(1, 4, 7),
y0 = c(1, 4, 7)))
# Regular polygons comes up as a special example when
# r_max = r_min / cos(pi / n_tips)
ggplot() +
geom_star(aes(r_min = 0.5, r_max = 0.5 / cos(pi / 5), n_tips = 5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.