Visualization VocabularyDataviz vocabulary
Diagram: barcode plot
Drawing: Adrien Taudière (CC0)
ggplot2 example: barcode plot
Adrien Taudière (CC0); R code ↓; data: Cavendish 1798, via HistData (Friendly et al. 2026) (GPL)

Classification

Channels

Attestation

Scientific literature

OpenAlex: 15 papers since 2020, 67% in the last five years; mostly in Biochemistry, Genetics and Molecular Biology, Computer Science, Medicine

R packages

R code of the ggplot2 example

library(ggplot2)
library(HistData)

## `density2` corrects a value that Cavendish read as 5.88 instead of 4.88.
p <- ggplot(Cavendish, aes(x = density2)) +
  geom_segment(aes(xend = density2, y = 0, yend = 1), colour = "#9b2367", linewidth = 0.6, alpha = 0.7) +
  annotate("segment", x = 5.517, xend = 5.517, y = -0.08, yend = 1.08, colour = "#535353", linewidth = 0.4,
           linetype = "dashed") +
  annotate("text", x = 5.517, y = 1.14, label = "Modern value, 5.517", size = 3.2, colour = "#535353") +
  scale_x_continuous(labels = lex_number, breaks = lex_break_breaks, expand = lex_break_expand) +
  scale_y_continuous(NULL, breaks = NULL) +
  labs(title = "Cavendish's 29 measurements surround the modern value",
       subtitle = "Density of the Earth relative to water, 1798, one line per determination",
       x = "Density of the Earth",
       caption = "Data: Cavendish 1798, via the HistData R package") +
  theme_lex_viz(grid = "", arrows = "x", break_not_zero = "x")

Sources (6)

5 occurrences in the corpus

Cite this entry

Stable addresshttps://dataviz.adrientaudiere.com/en-only/term/barcode-plot.html

ReferenceTaudière Adrien. 2026. barcode plot. In Visualization Vocabulary, version 1.0.0. IdEst. https://dataviz.adrientaudiere.com/en-only/term/barcode-plot.html

BibTeX
@incollection{taudiere2026-barcode-plot,
  author    = {Taudière, Adrien},
  title     = {barcode plot},
  booktitle = {Visualization Vocabulary},
  year      = {2026},
  version   = {1.0.0},
  publisher = {IdEst},
  url       = {https://dataviz.adrientaudiere.com/en-only/term/barcode-plot.html},
  note      = {CC0 1.0}
}

Page created on 2026-10-13. Text last changed on 2026-10-22. Images last changed on 2026-11-02. Numbers computed on 2026-10-22.