geom_barplot_counts | R Documentation |
Add text labels indicating counts above barplot columns. Works on plots that have a geom_bar() layer. Works even if you flip axis with coord_flip().
geom_barplot_counts( distance_from_bar = 1.5, orientation = "h", size = 4, fontface = "bold", alpha = 0.8, color = "black", family = "Helvetica" )
distance_from_bar |
distance between text and cbar |
orientation |
orientation of barplot ("h" / "horizontal" / "v" / "vertical") |
size |
size of text (number) |
fontface |
Font face ("plain", "italic", "bold", "bold.italic") (string) |
alpha |
transparancy (number) |
color |
colour (string) |
family |
font family (string) |
ggplot geom
mtcars %>% ggplot2::ggplot(ggplot2::aes(x=as.character(cyl))) + ggplot2::geom_bar() + ggplot2::xlab("cylinders") + geom_barplot_counts()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.