No slash command · from lab-skills
R ggplot2 plotting conventions and theme. Use when creating, modifying, or styling ggplot2 plots in R, or when adjusting plot themes, colors, labels, or formatting.
Ships in lab-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Always use theme_classic() as the base for plots. This provides a clean, minimal style without grid lines.
# Standard theme_clean function for all projects
theme_clean <- function(base_size = 12) {
theme_classic(base_size = base_size) +
theme(
plot.title = element_text(face = "bold", size = base_size * 1.1),
plot.subtitle = element_text(size = base_size * 0.9, color = "grey40"),
plot.title.position = "plot",
plot.caption.position = "plot",
plot.margin = margin(12, 12, 12, 12),
axis.line = element_line(linewidth = 0.4, color = "grey30"),
axis.ticks = element_line(linewidth = 0.3, color = "grey30"),
axis.text = element_text(size = base_size * 0.9, color = "grey20"),
axis.title = element_text(size = base_size, color = "grey20"),
legend.title = element_text(size = base_size * 0.9),
legend.text = element_text(size = base_size * 0.85),
strip.text = element_text(face = "bold", size = base_size),
strip.background = element_blank()
)
}
theme_classic() not theme_bw()Ensure text never overlaps or falls off the plot edge:
ggrepel for data labels — geom_text_repel() and geom_label_repel() prevent overlapaxis.text.x = element_text(angle = 45, hjust = 1)plot.margin if labels are clippedstr_wrap() for titles or labels exceeding plot width# Example: repel labels to avoid overlap
library(ggrepel)
ggplot(data, aes(x, y, label = gene)) +
geom_point() +
geom_text_repel(max.overlaps = 20, size = 3)
When creating multiple plots of the same type (e.g., per-module heatmaps, cluster markers), keep dimensions and styling consistent so they can be combined in a figure:
width and height in ggsave() for all plots of a typebase_size vary between related plotsscale_fill_* / scale_color_* once and reusecoord_fixed() or consistent width/height ratios# Example: define shared parameters for a set of heatmaps
HEATMAP_WIDTH <- 8
HEATMAP_HEIGHT <- 6
HEATMAP_BASE_SIZE <- 10
HEATMAP_COLORS <- scale_fill_gradient2(low = "blue", mid = "white", high = "red", midpoint = 0)
# Apply consistently to each plot
ggsave(filename, plot, width = HEATMAP_WIDTH, height = HEATMAP_HEIGHT)
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
34 skills in this plugin
/audit-projectPeriodic project health check - cross-check docs, prune conventions, find drift. Use when project documentation feels stale, before milestones, or when CLAUDE.md is getting long. Do NOT load for auditing skills (use /audit-skills) or data analysis scripts (use /audit-script).
/audit-scriptSystematic audit of data analysis scripts for bugs, analytical reasoning, data handling, style, and reproducibility. Includes domain verification phase that researches tools, file formats, and methods to catch domain-specific errors (not just code bugs). Use when auditing a script, reviewing code for correctness, checking for bugs, preparing a script for publication, or when the user says "audit this script", "review this code", "check this for bugs", or "is this script correct". Three modes: thorough (collaborative section-by-section), fast (Claude-driven with discussion), and report-only. Do NOT load for quick one-off questions about a single line or function.
/audit-skillsnpx claudepluginhub musserlab/lab-claude-skills --plugin lab-skills