
Small, reusable utilities for
ggplot2.
ggutils adds helpers that plug into the usual grammar – no new geometry, no special data format – so a plot keeps being a plot. Each one solves a concrete problem and is documented with runnable examples.
What is inside:
-
guide_axis_smart()– readable labels on crowded axes: pick the labels (which,n), spread them over several rows / columns without overlap, and tie every label back to its tick with a leader line. -
guide_axis_cluster()/scale_x_cluster()/scale_y_cluster()– hierarchical clustering on the axes: the axis is ordered by the dendrogram and the tree is drawn next to it, one tree per panel with free facets. On acoord_radial()plot the theta tree becomes a ring dendrogram (inside the hole or outside the circle) and a partial arc gets an arc-shaped r-axis tree. -
facet_gridn()–facet_grid()with scales that are free per panel instead of per row / column. -
coord_spiral()– an Archimedean spiral coordinate with matching angle and radial axes, for long sequences that would otherwise need many rows. -
Data and layout helpers – the bundled
airway_heatmap,pbmc3k_markersandpbmc3k_dotplotdata, plus the exported layout algorithmssmart_align(),box_arrange()andsmart_stack().
Installation
Requires R >= 4.1 and ggplot2 >= 4.0.0.
# install.packages("remotes")
remotes::install_github("junjunlab/ggutils")