Add text labels to a marimekko plot
geom_marimekko_text.RdAdd text labels to a marimekko plot
Usage
geom_marimekko_text(
mapping = NULL,
data = NULL,
position = "identity",
...,
size = 3.5,
colour = "white",
na.rm = FALSE,
show.legend = FALSE,
inherit.aes = FALSE
)Arguments
- mapping
Set of aesthetic mappings. Only
labelis required. Useggplot2::after_stat()for computed variables.- data
A data frame. Default
NULL(uses plot data; tile positions come fromgeom_marimekko()).- position
Position adjustment. Default
"identity".- ...
Additional arguments passed to the layer.
- size
Text size. Default
3.5.- colour
Text colour. Default
"white"for text,"black"for labels.- na.rm
Logical. Remove missing values. Default
FALSE.- show.legend
Logical. Show legend. Default
FALSE.- inherit.aes
Logical. Inherit aesthetics. Default
FALSE.
Examples
library(ggplot2)
titanic <- as.data.frame(Titanic)
ggplot(titanic) +
geom_marimekko(
aes(fill = Survived, weight = Freq),
formula = ~ Class | Survived
) +
geom_marimekko_text(aes(label = after_stat(weight)))