View source: R/geom-doughnut.R
geom_doughnut | R Documentation |
layer function to draw doughnut.
geom_doughnut(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
percent = FALSE,
rfill = "grey80",
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 |
stat |
The statistical transformation to use on the data for this
layer, either as a |
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
... |
Other arguments passed on to |
percent |
logical. If FALSE (the default) the value will be treated as source value. |
rfill |
the fill colour of other area. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
geom_doughnut()
understands the following aesthetics (required aesthetics are in bold):
x
y
r0
r1
value
colour
fill
alpha
size
linetype
Hou Yun
library(ggplot2)
dd <- tibble::tibble(x = runif(20, -180, 180),
y = runif(20, -90, 90),
value = purrr::map(sample(2:10, 20, TRUE), runif)
)
ggplot(dd, aes(x, y)) +
geom_doughnut(aes(value = value))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.