geom_barplot_counts: geom barplot counts

View source: R/geoms.R

geom_barplot_countsR Documentation

geom barplot counts

Description

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().

Usage

geom_barplot_counts(
  distance_from_bar = 1.5,
  orientation = "h",
  size = 4,
  fontface = "bold",
  alpha = 0.8,
  color = "black",
  family = "Helvetica"
)

Arguments

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)

Value

ggplot geom

Examples

mtcars %>%
ggplot2::ggplot(ggplot2::aes(x=as.character(cyl))) +
ggplot2::geom_bar() +
ggplot2::xlab("cylinders") +
geom_barplot_counts()

selkamand/utilitybeltgg documentation built on July 14, 2022, 2:32 p.m.