View source: R/ggplot-geom-pie.R
geom_pie | R Documentation |
Pie charts
geom_pie(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
clockwise = TRUE,
steps = 100,
lineend = "butt",
linejoin = "round",
linemitre = 10,
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.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
... |
Other arguments passed on to
|
clockwise |
A single boolean value indicates clockwise or not. |
steps |
An integer indicating the number of steps to generate the pie chart radian. Increasing this value results in a smoother pie circular. |
lineend |
Line end style (round, butt, square). |
linejoin |
Line join style (round, mitre, bevel). |
linemitre |
Line mitre limit (number greater than 1). |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
angle
: the pie circle angle.
angle0
: the initial pie circle angle.
radius
: the circle radius.
geom_pie()
understands the following aesthetics (required aesthetics are in bold):
x
y
angle
alpha
angle0
colour
fill
group
linetype
linewidth
radius
Learn more about setting these aesthetics in vignette("ggplot2-specs", package = "ggplot2")
.
ggplot(data.frame(x = 1:10, y = 1:10, value = 1:10 / sum(1:10))) +
geom_pie(aes(x, y, angle = value * 360))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.