View source: R/geom_polygon_theme.R
geom_polygon_theme | R Documentation |
This geom closely follows geom_polygon
, but take defaults from the
theme and are drawn through theme elements. They use the
elementalist.geom_polygon
theme element.
geom_polygon_theme(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
rule = "evenodd",
...,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE,
element = NULL
)
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
|
rule |
Either |
... |
Other arguments passed on to
|
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
element |
An |
A LayerInstance
object that can be added to a plot.
geom_polygon_theme()
understands the following aesthetics (required aesthetics are in bold):
x
y
alpha
colour
fill
group
linetype
linewidth
subgroup
Learn more about setting these aesthetics in vignette("ggplot2-specs")
.
df <- data.frame(
x = c(0, 0.5, 1, 0.5, 0.25, 0.5, 0.75, 0.5),
y = c(0.5, 0, 0.5, 1, 0.5, 0.25, 0.5, 0.75),
sub_id = rep(c(1, 2), each = 4),
id = rep(1, each = 8)
)
ggplot(df, aes(x, y, group = id, subgroup = sub_id)) +
geom_polygon_theme() +
theme(elementalist.geom_polygon = element_polygon_glow(colour = "blue"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.