Skip to main content

Module ggpubr

Module ggpubr 

Source
Expand description

ggpubr-style one-call plot constructors.

Thin wrappers that build a GGPlot pre-configured with the right aesthetics, geom, and the publication theme_pubr, mirroring R’s ggpubr::ggscatter / ggboxplot / … Each returns a GGPlot so you can keep chaining (add stat_cor, palettes, labels, save, …).

These are pure grammar — no statistics — so they’re always available (they don’t require the ggpubr feature, which only gates the stat annotations).

Functions§

ggarrange
Arrange several plots in a grid, composed into a single SVG document (ggpubr::ggarrange). Plots fill row-major across ncol columns; each occupies a cell_w × cell_h cell and is embedded as a positioned nested <svg> carrying data-panel="<index>". Returns the combined SVG string.
ggarrange_png
ggarrange rendered as a single PNG. Each plot is rasterised on its own (via the plotters bitmap backend) and composited into an ncol-wide grid. Returns the encoded PNG bytes. Requires the plotters feature (default).
ggarrange_save
ggarrange that writes the combined SVG to path.
ggarrange_save_png
ggarrange_png that writes the composited PNG to path.
ggboxplot
Publication box plot (ggpubr::ggboxplot). fill optionally maps a grouping column to box fill.
ggdensity
Publication density plot (ggpubr::ggdensity) of a single variable x. color optionally maps a grouping column to line colour.
gghistogram
Publication histogram (ggpubr::gghistogram) of a single variable x. fill optionally maps a grouping column to bar fill.
ggline
Publication line plot (ggpubr::ggline). color optionally maps a grouping column to line colour.
ggscatter
Publication scatter plot (ggpubr::ggscatter). color optionally maps a grouping column to point colour.
ggviolin
Publication violin plot (ggpubr::ggviolin). fill optionally maps a grouping column to violin fill.