Audits 'ggplot2' visualizations for accessibility issues, misleading
practices, and readability problems. Checks for color accessibility concerns
including colorblind-unfriendly palettes, misleading scale manipulations such
as truncated axes and dual y-axes, text readability issues like small fonts
and overlapping labels, and general accessibility barriers. Provides
comprehensive audit reports with actionable suggestions for improvement.
Color vision deficiency simulation uses methods from the 'colorspace'
package Zeileis et al. (2020)
Enemy of Bad Practices in Data Visualization
GGenemy is an R package that audits your ggplot2 visualizations for accessibility issues, misleading practices, and readability problems. Think of it as a linter for your data visualizations.
Data visualizations can inadvertently mislead or exclude audiences through:
GGenemy catches these issues automatically and suggests fixes.
# Install from CRAN (coming soon)
install.packages("GGenemy")
# Or install development version from GitHub:
# install.packages("devtools")
devtools::install_github("andytai7/GGenemy")
library(GGenemy)
library(ggplot2)
# Create a plot with some issues
p <- ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
geom_point() +
scale_color_manual(values = c("red", "green", "blue"))
# Run comprehensive audit
report <- gg_audit(p)
print(report)
# Check everything
gg_audit(your_plot)
# Check specific aspects
gg_audit(your_plot, checks = c("color", "scales"))
Detects problematic color combinations and suggests colorblind-safe alternatives:
gg_audit_color(your_plot)
See how your plot appears to colorblind users:
# Simulate different types of color vision deficiency
gg_simulate_cvd(your_plot, type = "deutan") # green-blind
gg_simulate_cvd(your_plot, type = "protan") # red-blind
gg_simulate_cvd(your_plot, type = "tritan") # blue-blind
Catches misleading practices:
gg_audit_scales(your_plot)
Get code suggestions or apply fixes automatically:
# Get copy-paste code suggestions
gg_suggest_fixes(your_plot)
# Apply automatic fixes
fixed_plot <- gg_suggest_fixes(your_plot, auto_fix = TRUE)
Checks for:
gg_audit_accessibility(your_plot)
library(ggplot2)
library(GGenemy)
# Create a problematic plot
problematic_plot <- ggplot(mtcars, aes(x = wt, y = mpg, color = factor(cyl))) +
geom_point(size = 1) +
scale_color_manual(values = c("red", "green", "blue")) +
labs(title = "Plot", x = "wt", y = "mpg")
# Audit it
report <- gg_audit(problematic_plot)
# Get fix suggestions
gg_suggest_fixes(problematic_plot)
# Apply automatic fixes
improved_plot <- gg_suggest_fixes(problematic_plot, auto_fix = TRUE)
# View the improved plot
print(improved_plot)
GGenemy believes in:
GGenemy is in active development! Contributions are welcome:
citation("GGenemy")
MIT © Andy Man Yeung Tai
GGenemy: Making data visualization more accessible, honest, and clear.