Visualization VocabularyDataviz vocabulary
Diagram: data table
Drawing: Adrien Taudière (CC0)
ggplot2 example: data table
Adrien Taudière (CC0); R code ↓; data: gapminder (Bryan 2025) (CC BY 4.0)

Examples

Classification

  • chart
  • matrices and tables › tables

Channels

Attestation

R packages

R code of the ggplot2 example

library(ggplot2)
library(dplyr)
library(gapminder)

## A table drawn with ggplot2: one text per cell, numbers right-aligned on
## the right edge of their column, a rule under the header.
rows <- gapminder |>
  filter(year == 2007) |>
  group_by(continent) |>
  summarise(countries = n(), pop = sum(as.numeric(pop)) / 1e6,
            life = median(lifeExp), gdp = median(gdpPercap)) |>
  mutate(row = rev(seq_along(continent)))
columns <- tibble(x = c(0, 2.9, 4.6, 6.2, 7.9), hjust = c(0, 1, 1, 1, 1),
                  header = c("Continent", "Countries", "Population\n(millions)",
                             "Median life\nexpectancy", "Median GDP per\ncapita (US$)"))
cells <- bind_rows(
  tibble(col = 1, label = as.character(rows$continent), row = rows$row),
  tibble(col = 2, label = as.character(rows$countries), row = rows$row),
  tibble(col = 3, label = lex_number(round(rows$pop)), row = rows$row),
  tibble(col = 4, label = sprintf("%.1f", rows$life), row = rows$row),
  tibble(col = 5, label = lex_number(round(rows$gdp)), row = rows$row)
) |>
  mutate(x = columns$x[col], hjust = columns$hjust[col])

p <- ggplot() +
  geom_text(data = columns, aes(x = x, y = 6.1, label = header, hjust = hjust),
            vjust = 0, fontface = "bold", colour = "black", size = 3, lineheight = 0.9) +
  annotate("segment", x = 0, xend = 7.9, y = 5.75, yend = 5.75, colour = "#535353", linewidth = 0.4) +
  geom_text(data = cells, aes(x = x, y = row, label = label, hjust = hjust),
            colour = "#262626", size = 3.2) +
  scale_y_continuous(limits = c(0.5, 7.2)) +
  labs(title = "Asia held 61% of the population of the 142 countries",
       subtitle = "Gapminder countries in 2007, by continent",
       x = NULL, y = NULL,
       caption = "Data: Gapminder, via the gapminder R package") +
  theme_lex_viz(grid = "", arrows = "") +
  theme(axis.text = element_blank())

Sources (93)

3967 occurrences in the corpus; indexed by 19 books

Show the 93 sources

Cite this entry

Stable addresshttps://dataviz.adrientaudiere.com/en-only/term/data-table.html

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

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

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