Install
openclaw skills install generating-publication-ready-figures-in-rTransform standard ggplot2 figures into publication-quality visualizations matching Nature, Science, and other top journal styles with proper themes, colors,...
openclaw skills install generating-publication-ready-figures-in-rThis skill specializes in transforming ordinary ggplot2 plots into professional, publication-ready figures that meet the strict standards of top-tier journals like Nature, Science, Cell, and others.
Use this skill when the user wants to:
When activated, this skill will:
Analyze existing ggplot code - Read and understand the current plot structure
Apply journal themes - Add publication-quality themes including:
Optimize for submission - Ensure figures meet:
Create multi-panel figures - Combine plots using:
patchwork for simple layoutscowplot for complex compositionsExport properly - Save with correct:
theme_nature()Clean, minimalist theme matching Nature journals:
theme_science()Theme for Science journal submissions:
theme_cellpress()Cell Press journal theme:
theme_colorblind()Colorblind-safe palette with:
# Primary colors
nature_colors <- c(
blue = "#3B4992",
red = "#EE0000",
green = "#008B45",
purple = "#631879"
)
scale_fill_viridis()scale_color_okabe_ito() (Okabe-Ito palette)scale_color_viridis()User: Here's my ggplot code, make it Nature-style.
# Original plot
p <- ggplot(mtcars, aes(x = wt, y = mpg, color = factor(cyl))) +
geom_point(size = 3)
Skill transforms to:
# Publication-ready version
p <- ggplot(mtcars, aes(x = "Weight (tons)", y = "Fuel Efficiency (mpg)",
color = "Cylinders")) +
geom_point(size = 2.5, shape = 16, alpha = 0.8) +
scale_color_nature() +
theme_nature(base_size = 8) +
labs(title = NULL)
# Export at correct size
ggsave("figure1.pdf", p, width = 3.5, height = 3, dpi = 300,
device = "pdf")
# Combine plots with patchwork
library(patchwork)
figure1 <- (panel_a | panel_b) / (panel_c | panel_d)
# Add panel labels
figure1 <- figure1 +
plot_annotation(tag_levels = "A",
tag_suffix = ")")
# Export
ggsave("figure1.pdf", figure1, width = 7, height = 6, dpi = 300)
| Purpose | R Packages |
|---|---|
| Base plotting | ggplot2 |
| Themes | ggplot2, cowplot, hrbrthemes |
| Color palettes | viridis, RColorBrewer, scales, ggsci |
| Multi-panel | patchwork, cowplot, ggpubr |
| Export | ggplot2, ragg |
| Fonts | extrafont, showtext |
| Annotations | ggrepel, ggpp |
| Journal | Width (single) | Width (double) | Max Height | Min DPI |
|---|---|---|---|---|
| Nature | 89 mm | 183 mm | 234 mm | 300 |
| Science | 57 mm | 114 mm | 229 mm | 300 |
| Cell | 85 mm | 178 mm | 229 mm | 300 |
| PNAS | 87 mm | 178 mm | 227 mm | 300 |
| PLOS ONE | 170 mm | - | 230 mm | 300 |
| eLife | 183 mm | - | 244 mm | 300 |
p + theme_nature() # Nature style
p + theme_science() # Science style
p + theme_cellpress() # Cell Press style
p + theme_colorblind() # Colorblind-safe
# Vector (preferred)
ggsave("figure.pdf", ... device = "pdf")
ggsave("figure.eps", ... device = "eps")
# Raster (high DPI)
ggsave("figure.tiff", ... device = "tiff", dpi = 600)
ggsave("figure.png", ... device = "png", dpi = 300)
base_size in themetheme(legend.position = "bottom")scale_fill_viridis()extrafont::font_import()colorblindr package