geom_xsidebar | R Documentation |
The xside and yside variants of geom_bar is geom_xsidebar and geom_ysidebar. These variants both inherit from geom_bar and only differ on where they plot data relative to main panels.
The xside and yside variants of geom_col is geom_xsidecol and geom_ysidecol. These variants both inherit from geom_col and only differ on where they plot data relative to main panels.
geom_xsidebar(
mapping = NULL,
data = NULL,
stat = "count",
position = "stack",
...,
just = 0.5,
width = NULL,
na.rm = FALSE,
orientation = "x",
show.legend = NA,
inherit.aes = TRUE
)
geom_ysidebar(
mapping = NULL,
data = NULL,
stat = "count",
position = "stack",
...,
just = 0.5,
width = NULL,
na.rm = FALSE,
orientation = "y",
show.legend = NA,
inherit.aes = TRUE
)
geom_xsidecol(
mapping = NULL,
data = NULL,
position = "stack",
...,
just = 0.5,
width = NULL,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
geom_ysidecol(
mapping = NULL,
data = NULL,
position = "stack",
...,
just = 0.5,
width = NULL,
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE,
orientation = "y"
)
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 |
just |
Adjustment for column placement. Set to |
width |
Bar width. By default, set to 90% of the |
na.rm |
If |
orientation |
The orientation of the layer. The default ( |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
XLayer or YLayer object to be added to a ggplot object
Required aesthetics are in bold.
x
y
fill
or xfill
Fill color of the xsidebar
fill
or yfill
Fill color of the ysidebar
width
specifies the width of each bar
height
specifies the height of each bar
alpha
Transparency level of xfill
or yfill
size
size of the border line.
geom_xsidehistogram, geom_ysidehistogram
p <-ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species, fill = Species)) +
geom_point()
#sidebar - uses StatCount
p +
geom_xsidebar() +
geom_ysidebar()
#sidecol - uses Global mapping
p +
geom_xsidecol() +
geom_ysidecol()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.