{"id":18696634,"url":"https://github.com/sergiocorreia/fedplot","last_synced_at":"2026-06-24T03:34:32.842Z","repository":{"id":171766449,"uuid":"641751667","full_name":"sergiocorreia/fedplot","owner":"sergiocorreia","description":"R package to create ggplot2 charts in the style used by the Fed's FSR","archived":false,"fork":false,"pushed_at":"2023-08-08T19:15:41.000Z","size":6717,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-19T00:38:39.660Z","etag":null,"topics":["ggplot2","ggplot2-themes"],"latest_commit_sha":null,"homepage":"https://sergiocorreia.github.io/fedplot","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/sergiocorreia.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}},"created_at":"2023-05-17T05:13:32.000Z","updated_at":"2025-04-14T00:33:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9d3e168-f304-4086-af31-56bb1f337c04","html_url":"https://github.com/sergiocorreia/fedplot","commit_stats":null,"previous_names":["sergiocorreia/fedplot"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/sergiocorreia/fedplot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiocorreia%2Ffedplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiocorreia%2Ffedplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiocorreia%2Ffedplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiocorreia%2Ffedplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergiocorreia","download_url":"https://codeload.github.com/sergiocorreia/fedplot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiocorreia%2Ffedplot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34716325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ggplot2","ggplot2-themes"],"created_at":"2024-11-07T11:19:55.888Z","updated_at":"2026-06-24T03:34:32.822Z","avatar_url":"https://github.com/sergiocorreia.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `fedplot`: Fed-style ggplot2 charts \u003cimg src=\"man/figures/logo.png\" align=\"right\" alt=\"fedplot logo\" width=\"128\" /\u003e\n\nThis is an R package that allows users to replicate Fed-style plots (e.g. [FSR](https://www.federalreserve.gov/publications/financial-stability-report.htm), [Tealbook](https://www.federalreserve.gov/monetarypolicy/fomc_historical_year.htm)) within ggplot. It contains a theme and several ggplot functions to customize and export figures.\n\nIt's currently a work-in-progress (version 0.2), with planned improvements including:\n\n1. Wrappers around options, so they are less verbose (e.g. `scale_*` below).\n2. Documentation and website.\n3. Better automated placement of legend and text labels.\n4. Better testing of different OSes and chart types.\n5. Document that fonts and other options can be changed through `options()`\n\n\n## Quick example\n\n(Also see [here](/internal/line3.R) for a self-contained script)\n\n```R\nlibrary(fedplot)\n\nggplot(plotdata, aes(x = Date, y = value, group=source)) +\n  geom_recessions()\n  geom_hline(yintercept = 0, linewidth = getOption(\"fedplot.linewidth_adj\"), linejoin = \"mitre\", lineend = \"round\") +\n  geom_line(aes(color=source, linewidth=source), na.rm = T, linejoin = \"mitre\", lineend = \"round\") +\n  labs(y = \"12-month percent change\") +\n  scale_x_date(minor_breaks=seq(from=as.Date(\"2003-01-01\"), to=as.Date(\"2023-01-01\"), by=\"1 years\"),\n               breaks=seq(from=as.Date(\"2004-06-30\"), to=as.Date(\"2023-06-30\"), by=\"3 years\"),\n               date_labels=\"%Y\",\n               expand=expansion(mult=.10)) +\n  scale_y_continuous(sec.axis = dup_axis(),\n                     breaks = seq(-25, 25, by=5),\n                     limits = c(-25, 25),\n                     expand = expansion(mult=0),\n                     labels = scales::label_number(style_negative = \"minus\")) +\n  annotate_last_date(nudge_y = -3, nudge_x = 0) +\n  theme_fed(legend_position = c(.55, .5))\n\nsave_plot('my-figure', size='narrow', extension='png')\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./man/figures/example.png\" alt=\"FSR Example\" width=\"55%\"/\u003e\n\u003c/p\u003e\n\n## Installation\n\nTo install or update `fedplot`:\n\n```\n## Install current version from GitHub\ndevtools::install_github(\"fedplot/fedplot\", build_vignettes=FALSE)\n\n## Then load the package as you would any other\nlibrary(fedplot)\n```\n\n## To-Do\n\n1. Add documentation and pkgdown website\n2. Convert `line.R` into a vignette.\n3. Add examples for bar charts\n4. Add wrappers to the geom_hline (maybe set as an option to `theme_fed`), to the scale_* functions, and to geom_line (so it uses the group aes into its color and linewidth aes, plus the other options).\n\n### Possible improvements\n\n1. Ensure that certain geometries (e.g. recession bars) are always in the background, independently on the order in which they were added. This can be achieved with e.g. `move_layers` from the [`gginnards`](https://docs.r4photobiology.info/gginnards/reference/delete_layers.html) package.\n\n\n## Acknowledgments\n\n- Recession bars as well as some design ideas are based on the great [`cmapplot`](https://github.com/CMAP-REPOS/cmapplot/) library mantained by the Chicago Metropolitan Agency for Planning. \n\n\n## Useful references:\n\n- `ggplot_add` magic: https://www.simonpcouch.com/blog/ggplot-pipe-plus/ , https://yutani.rbind.io/post/2017-11-07-ggplot-add/\n- Editing the DESCRIPTION file: https://r-pkgs.org/description.html , https://kbroman.org/pkg_primer/pages/depends.html , https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Package-Dependencies\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergiocorreia%2Ffedplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergiocorreia%2Ffedplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergiocorreia%2Ffedplot/lists"}