{"id":44811041,"url":"https://github.com/ukhsa-collaboration/ggbreak","last_synced_at":"2026-02-16T16:52:37.241Z","repository":{"id":304969259,"uuid":"866536554","full_name":"ukhsa-collaboration/ggbreak","owner":"ukhsa-collaboration","description":"One-function R package for adding a y-axis break symbol to a ggplot object","archived":false,"fork":false,"pushed_at":"2026-01-16T11:33:46.000Z","size":35,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-17T01:17:07.204Z","etag":null,"topics":["data-visualization"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ukhsa-collaboration.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-02T12:48:05.000Z","updated_at":"2026-01-16T11:33:50.000Z","dependencies_parsed_at":"2026-01-16T15:18:23.215Z","dependency_job_id":null,"html_url":"https://github.com/ukhsa-collaboration/ggbreak","commit_stats":null,"previous_names":["ukhsa-collaboration/ggbreak"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ukhsa-collaboration/ggbreak","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ukhsa-collaboration%2Fggbreak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ukhsa-collaboration%2Fggbreak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ukhsa-collaboration%2Fggbreak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ukhsa-collaboration%2Fggbreak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ukhsa-collaboration","download_url":"https://codeload.github.com/ukhsa-collaboration/ggbreak/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ukhsa-collaboration%2Fggbreak/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29513352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-visualization"],"created_at":"2026-02-16T16:52:36.549Z","updated_at":"2026-02-16T16:52:37.236Z","avatar_url":"https://github.com/ukhsa-collaboration.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ggbreak\n\n## Purpose\n\nggbreak is a one-function R package for adding a [y-axis break symbol](https://commons.wikimedia.org/wiki/File:Y-axis_break.svg) to a line chart made using ggplot2.\n\n\u003e [!IMPORTANT]\n\u003e The function will return an error if any other chart type is supplied.\n\nThe package has been developed to support analysts in ensuring their charts comply with [Government Analysis Function data visualisation guidance](https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/) on breaking or truncating the numerical axis.\n\nCurrent Analysis Function guidance recommends drawing the break symbol on charts in Microsoft PowerPoint. Using `add_break_symbol()` is a reproducible alternative which you can include in your typical data visualisation workflow.\n\n\u003e [!CAUTION]\n\u003e The package is currently under development. Please report any bugs as [Issues](https://github.com/ukhsa-collaboration/ggbreak/issues).\n\n## Installation\n\nggbreak can be installed directly from the [UKHSA-Collaboration GitHub page](https://github.com/ukhsa-collaboration):\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"UKHSA-Collaboration/ggbreak\")\n```\n\n## Getting started\n\nLet's start by creating a basic line chart using ggplot2.\n\n### Basic line chart with no break symbol\n\nHere, the y-axis does not start at zero or a natural baseline.\n\n``` r\nlibrary(ggplot2)\nlibrary(scales)\n\nset.seed(666)\n\ndf \u003c- data.frame(x = 1:30, y = rnorm(30, mean = 0.7, sd = 0.1))\n\np \u003c- ggplot(df, aes(x, y)) +\n  geom_line()\n\np\n```\n\n![](man/img/plot-without-symbol.svg)\n\nNow, let's add a break symbol to the y-axis, specifying the break symbol at y = 0.4.\n\n### Example 1: basic line chart with break symbol\n\n`add_break_symbol()` can take a range of additional arguments which control the scale of the y-axis and the formatting of the break symbol.\n\nFor this reason, you should not use `scale_y_continuous()` to format your y-axis (for example the breaks, labels, limits) – all formatting of the y-axis is handled by `add_break_symbol()` and must be specified by the user. At minimum, you must provide a gg or ggplot object and a break symbol position (`break_at`) for the function to work.\n\n``` r\nadd_break_symbol(p, break_at = 0.4)\n```\n\n![](man/img/plot-with-symbol.svg)\n\n### Example 2: line chart with break symbol and Analysis Function theme\n\n`add_break_symbol()` works well when used with the Government Analysis Function's [afcharts package](https://best-practice-and-impact.github.io/afcharts/).\n\n``` r\nlibrary(afcharts)\n\nplot_break_af \u003c- \n  ggplot(df, aes(x, y)) +\n  geom_line(colour = af_colour_values[1],\n            linewidth = 1.2) +\n  theme_af(ticks = \"x\") +\n  labs(x = \"Independent variable\",\n       y = NULL,\n       subtitle = \"Dependent variable\")\n\nadd_break_symbol(\n  plot_break_af,\n  break_at = 0.35,\n  y_breaks = seq(0.3, 1, 0.1),\n  y_labels = scales::label_percent(),\n  y_limits = c(0.3, 1),\n  y_origin_override = 0\n)\n```\n\n![](man/img/af-plot-with-symbol.svg)\n\n## Acknowledgements\n\nAuthor(s):\n\nHead of Profession for Statistics Office\\\nAnalytical Quality Assurance and Standards\\\nAnalysis and Intelligence Assessment\\\nChief Data Officer Group\\\nUK Health Security Agency\n\n## Licence\n\nUnless stated otherwise, the codebase is released under MIT License. This covers both the codebase and any sample code in the documentation.\n\nThe documentation is [Crown copyright](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/) and available under the terms of the [Open Government 3.0 licence](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fukhsa-collaboration%2Fggbreak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fukhsa-collaboration%2Fggbreak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fukhsa-collaboration%2Fggbreak/lists"}