ggalt 0.6.2
  • Reference
  • Articles
    • Annotation Ticks
    • Density Plots
    • Dumbbell Charts
    • Encircling Points
    • Horizon Plots
    • Lollipop charts
    • Coord Projection
    • Spikelines
    • Spline Plots
    • ProPublica StateFace
    • Step Ribbons
    • Uniform Bars
    • Vertical Dodging
  • Changelog

Dumbbell Charts

Bob Rudis

2019-02-22

Source: vignettes/dumbell.Rmd
dumbell.Rmd

Dumbbell Charts

library(ggplot2)
library(gridExtra)
library(ggalt)
library(scales)
df <- data.frame(trt=LETTERS[1:5], l=c(20, 40, 10, 30, 50), r=c(70, 50, 30, 60, 80))

ggplot(df, aes(y=trt, x=l, xend=r)) + 
  geom_dumbbell(size=3, color="#e3e2e1", 
                colour_x = "#5b8124", colour_xend = "#bad744",
                dot_guide=TRUE, dot_guide_size=0.25) +
  labs(x=NULL, y=NULL, title="ggplot2 geom_dumbbell with dot guide") +
  theme_minimal() +
  theme(panel.grid.major.x=element_line(size=0.05)) +
  theme(panel.grid.major.y=element_blank())

Contents

  • Dumbbell Charts

Developed by Bob Rudis, Ben Bolker, Jan Schulz, Aditya Kothari, Jonathan Sidi.

Site built with pkgdown.