Skip to content
DraconiticResearch
Search Sources API
189,105 studies31 sourcesUpdated 25 min ago
PreprintarXiv licencearXiv

Contrast-Aware Annotation for Statistical Graphics: The ggtwotone Package for ggplot2

Abstract

Readable annotations are essential for interpreting statistical graphics, yet conventional single-color lines and labels can lose visibility when they cross backgrounds with heterogeneous luminance. We introduce a contrast-aware annotation framework implemented in the ggtwotone R package for ggplot2. The framework combines dual-stroke rendering, adaptive text-color selection, and perceptually guided highlight palettes to improve annotation visibility across light and dark regions. A shared contrast-adjustment engine supports WCAG- and APCA-based contrast criteria, reducing the need for manual color adjustment. The package provides contrast-aware geoms for segments, curves, paths, mathematical functions, regression overlays, and text while remaining compatible with standard ggplot2 workflows. A simulation-based evaluation across heterogeneous background colors demonstrates improved worst-case contrast for dual-stroke annotations and adaptive text selection, while also identifying trade-offs in perceptual separation as the number of requested highlight colors increases. Applications to statistical graphics and scientific images illustrate the framework in practical visualization settings. Together, these tools provide a reproducible approach for incorporating contrast considerations directly into graphical annotation.

Related

  1. R-package agentBayes: Likelihood-based statistical methods for agent-based models
    Niklas Moser, Dmitri Finkelshtein, Georgy Chargaziya +5
    PLOS Computational BiologyPeer-reviewedCC BY 4.0Full textAnalysis & PDEsProbabilityPLOS
  2. Reframing Spatial Uncertainty Visualisation with a Layered Grammar of Graphics
    Maggie Xueqi Ma, Weihao Li, Quan Vu +2
    arXivPreprintarXiv licenceFull textStatisticsarXiv
  3. Interactive and Robust PCA Graphics with FSDA in MATLAB
    Marco Riani, Anthony C. Atkinson, Aldo Corbellini +3
    arXivPreprintCC BY 4.0Full textStatisticsarXiv
  4. OptimalControl.jl: a Julia package to model and solve optimal control problems with ODEs
    Jean-Baptiste Caillau, Olivier Cots, Joseph Gergaud +2
    Journal of Open Source SoftwarePeer-reviewedCC BYFull textGeneral mathematicsHAL
  5. postshock: An R Package for Donor-Adjusted Forecasting After Structural Shocks
    Qiyang Wang, Daniel J. Eck
    arXivPreprintarXiv licenceFull textStatisticsarXiv
BibTeX
@misc{sareena2026contrastaware,
  title = {{Contrast-Aware Annotation for Statistical Graphics: The ggtwotone Package for ggplot2}},
  author = {Beenu Sareena and Heike Hofmann},
  howpublished = {arXiv},
  year = {2026},
  month = sep,
  doi = {10.48550/arxiv.2609.30627},
  eprint = {2609.30627},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.30627},
}
RIS
TY  - UNPB
TI  - Contrast-Aware Annotation for Statistical Graphics: The ggtwotone Package for ggplot2
AU  - Beenu Sareena
AU  - Heike Hofmann
PY  - 2026
DA  - 2026/09/24
PB  - arXiv
DO  - 10.48550/arxiv.2609.30627
UR  - https://arxiv.org/abs/2609.30627
AB  - Readable annotations are essential for interpreting statistical graphics, yet conventional single-color lines and labels can lose visibility when they cross backgrounds with heterogeneous luminance. We introduce a contrast-aware annotation framework implemented in the ggtwotone R package for ggplot2. The framework combines dual-stroke rendering, adaptive text-color selection, and perceptually guided highlight palettes to improve annotation visibility across light and dark regions. A shared contrast-adjustment engine supports WCAG- and APCA-based contrast criteria, reducing the need for manual color adjustment. The package provides contrast-aware geoms for segments, curves, paths, mathematical functions, regression overlays, and text while remaining compatible with standard ggplot2 workflows. A simulation-based evaluation across heterogeneous background colors demonstrates improved worst-case contrast for dual-stroke annotations and adaptive text selection, while also identifying trade-offs in perceptual separation as the number of requested highlight colors increases. Applications to statistical graphics and scientific images illustrate the framework in practical visualization settings. Together, these tools provide a reproducible approach for incorporating contrast considerations directly into graphical annotation.
ER  -