geom_bartext: Labeled Bar Charts

Description Usage Examples

Description

This function adds a geom_bartext geom which essentially composes geom_bar() and geom_text()

Usage

1
2
3
geom_bartext(mapping = NULL, data = NULL, position = "stack", ...,
  width = NULL, na.rm = FALSE, show.legend = NA,
  inherit.aes = TRUE, parse = FALSE)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(dplyr)
library(ggplot2)

mpg_manu <- mpg %>%
    distinct(manufacturer, model)

ggplot(mpg_manu, aes(x = manufacturer)) +
    geom_bartext(aes(label = model))

ggplot(mpg_manu, aes(x = manufacturer)) +
    geom_bartext(aes(label = model), colour = "red", textcolour = "black", fill = "white")

Omni-Analytics-Group/bartext documentation built on May 26, 2019, 3:31 p.m.