geom_xsidebar {ggside} | R Documentation |
Side bar Charts
Description
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.
Usage
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"
)
Arguments
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 |
Value
XLayer or YLayer object to be added to a ggplot object
Aesthetics
Required aesthetics are in bold.
-
x
-
y
-
fill
orxfill
Fill color of the xsidebar -
fill
oryfill
Fill color of the ysidebar -
width
specifies the width of each bar -
height
specifies the height of each bar -
alpha
Transparency level ofxfill
oryfill
-
size
size of the border line.
See Also
geom_xsidehistogram, geom_ysidehistogram
Examples
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()