Visualization VocabularyDataviz vocabulary
Diagram: ROC curve
Drawing: Adrien Taudière (CC0)
ggplot2 example: ROC curve
Adrien Taudière (CC0); R code ↓; data: Heart Disease (Janosi et al. 1989), via datarium (CC BY 4.0)
Wikidata image: ROC curve
BOR at English Wikipedia (CC BY-SA 3.0); Wikimedia Commons; item Q327120

chart

ROC curve

Sensitivity against false positive rate of a classifier.

courbe ROC

Sensibilité contre taux de faux positifs d'un classifieur.

Classification

  • chart
  • lines and areas › statistical curves
  • correlation

Channels

Attestation

Scientific literature

OpenAlex: 154 188 papers since 1890, 49% in the last five years; mostly in Medicine, Biochemistry, Genetics and Molecular Biology, Computer Science; Wikidata

Seminal references

R packages

R code of the ggplot2 example

library(ggplot2)
library(dplyr)
library(pROC)

## Heart disease is any narrowing of a coronary artery (`num` above 0).
patients <- datarium::heartdisease |>
  filter(!is.na(thalach), !is.na(oldpeak)) |>
  mutate(disease = num > 0)

curve_of <- function(predictor, name) {
  r <- roc(patients$disease, patients[[predictor]], quiet = TRUE)
  tibble(test = sprintf("%s, AUC %.2f", name, auc(r)),
         fpr = 1 - r$specificities,
         tpr = r$sensitivities) |>
    arrange(fpr, tpr)
}
curves <- bind_rows(curve_of("oldpeak", "ST depression"),
                    curve_of("thalach", "Maximum heart rate"))

tests <- tibble(test = unique(curves$test), fpr = 0.45, tpr = c(0.24, 0.14))

p <- ggplot(curves, aes(x = fpr, y = tpr, colour = test)) +
  geom_abline(colour = "#7d7d7d", linewidth = 0.4, linetype = "dashed") +
  annotate("text", x = 0.62, y = 0.56, label = "Chance", hjust = 0, size = 3, colour = "#7d7d7d") +
  geom_path(linewidth = 0.7) +
  geom_text(data = tests, aes(label = test), hjust = 0, size = 3.2, fontface = "bold") +
  scale_x_continuous(labels = lex_number, expand = expansion(mult = c(0, 0.04))) +
  scale_y_continuous(labels = lex_number, expand = c(0, 0)) +
  labs(title = "Two measures detect heart disease about equally well",
       subtitle = "857 patients; each step of a curve is one threshold for a positive test",
       x = "False positive rate", y = "Sensitivity",
       caption = "Data: Heart Disease (Janosi et al. 1989), via the datarium R package") +
  theme_lex_viz(grid = "xy", arrows = "xy") +
  theme(legend.position = "none")

Sources (5)

Cite this entry

Stable addresshttps://dataviz.adrientaudiere.com/en/term/roc-curve.html

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

BibTeX
@incollection{taudiere2026-roc-curve,
  author    = {Taudière, Adrien},
  title     = {ROC curve},
  booktitle = {Visualization Vocabulary},
  year      = {2026},
  version   = {1.0.0},
  publisher = {IdEst},
  url       = {https://dataviz.adrientaudiere.com/en/term/roc-curve.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.