Visualization VocabularyDataviz vocabulary
Diagram: density plot
Drawing: Adrien Taudière (CC0)
ggplot2 example: density plot
Adrien Taudière (CC0); R code ↓; data: palmerpenguins (Horst, Hill & Gorman 2020) (CC0)

chart

density plot

also: kernel density plot

Smoothed estimate of a continuous variable's distribution.

courbe de densité

Estimation lissée de la distribution d'une variable continue.

Classification

  • chart
  • lines and areas › statistical curves
  • distribution

Channels

Variants

Attestation

Scientific literature

OpenAlex: 3 466 papers since 1960, 38% in the last five years; mostly in Physics and Astronomy, Engineering, Medicine

Seminal references

R packages

R code of the ggplot2 example

library(ggplot2)
library(dplyr)
library(palmerpenguins)

flippers <- penguins |>
  filter(!is.na(flipper_length_mm))

peaks <- flippers |>
  group_by(species) |>
  summarise(d = list(density(flipper_length_mm))) |>
  mutate(x = sapply(d, \(d) d$x[which.max(d$y)]),
         ## Moved right, off the Adelie curve.
         x = x + ifelse(species == "Chinstrap", 4, 0),
         y = sapply(d, \(d) max(d$y)))

p <- ggplot(flippers, aes(x = flipper_length_mm, colour = species, fill = species)) +
  geom_density(alpha = 0.25, linewidth = 0.6) +
  geom_text(data = peaks, aes(x = x, y = y, label = species), vjust = -0.6, size = 3.5) +
  scale_x_continuous(labels = lex_number, breaks = lex_break_breaks, expand = lex_break_expand) +
  scale_y_continuous(expand = expansion(mult = c(0, 0.12))) +
  labs(title = "Gentoo penguins have the longest flippers",
       x = "Flipper length (mm)", y = "Density",
       caption = "Data: palmerpenguins (Horst, Hill & Gorman 2020)") +
  theme_lex_viz(grid = "x", break_not_zero = "x") +
  theme(legend.position = "none")

Sources (23)

43 occurrences in the corpus; indexed by 3 books

Show the 23 sources

Cite this entry

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

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

BibTeX
@incollection{taudiere2026-density-plot,
  author    = {Taudière, Adrien},
  title     = {density plot},
  booktitle = {Visualization Vocabulary},
  year      = {2026},
  version   = {1.0.0},
  publisher = {IdEst},
  url       = {https://dataviz.adrientaudiere.com/en/term/density-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-12. Numbers computed on 2026-10-22.