Set Axis Break for 'ggplot2'
Overview
An implementation of scale functions for setting axis breaks of a 'gg' plot (S Xu (2021) doi:10.3389/fgene.2021.774846).
- the axis title of a broken plot is now drawn exactly once, whatever it comes from; the #85 entry of 0.2.0 was about the defect #53 fixed and assumed a title set with
labs(), and the report came back for a title given as thenameof a position scale --scale_x_continuous("test")-- where five things went wrong together. The labels of the figure were read offggplot_build(plot)$plot$labels, which only holds whatlabs()set plus the aesthetic defaults, so a plot whose scale is named "test" reported its title as "x" and the copy hoisted above a bottom legend carried the wrong text;ggplot2::get_labs()is used now, which returns the completed labels. A window blanked its title withguides(x = guide_axis(title = NULL)), and that does not beat thenameof a scale, soscale_wrap()and the cut scales printed the title once per window; the theme element is blanked instead, and only on the windows, so the figure still draws it.check_axis_title()added the title to the outer ggplot a second time as a guide axis, whose row sits *below* the collected legend, which is why a scale-named title came out twice, once above the legend and once below it; only the secondary-axis title is left there, becauselabs()cannot set it.grid.draw.ggwrap()wrote the hoisted label back withtotallabs$x <- NULL, and assigningNULLdrops the element rather than clearing it, so a wrap drew a stray "x" under its legend. And the title is moved out of the panel byalign_assembled_figure(), so a broken plot with a legend at the bottom keeps it whenpatchworkorcowplottake it throughggplotGrob()instead of being handed over titleless (2026-09-22, Tue, #85)
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- WARNING12 OK, 1 WARNING2026-06-07
Show 1 earlier changeHide 1 earlier change
- OK14 OK2026-03-10
Documentation
- Help pages
- 4 (1 internal)includes a package overview page
- Examples that run
- 100%3 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 921
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Issues over time
PRs over time
Commits over time
Commit identities over time
2 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/yulab-smu/ggbreak on 2026-10-21.
Dependencies
Installing ggbreak adds 34 packages (15 with compiled code, 22 MB of source tarballs). Heaviest: ggplot2 6.0 MB, patchwork 3.2 MB, isoband 1.5 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.2.2Latest
- RR 4.6.0 released · 2026-04-24
- 0.1.72026-03-18 · diff ↗
- 0.1.62025-08-24 · diff ↗
- 0.1.52025-07-02 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 0.1.42025-02-04 · diff ↗
- 0.1.32025-01-08 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 0.1.22023-06-26 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 0.1.12022-10-16 · diff ↗
- 0.1.02022-06-01 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 0.0.92022-02-05 · diff ↗
- 0.0.82022-01-12 · diff ↗
Show 8 earlier eventsHide 8 earlier events
Package metadata
- First published
- 2021-05-13
- Total releases
- 17 / 5 yrs
- License
- Artistic-2.0 OSI
- Download size
- 842 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("ggbreak")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.3389/fgene.2021.774846.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.