{"id":13712585,"url":"https://github.com/Greater-London-Authority/gglaplot","last_synced_at":"2025-05-06T22:31:21.904Z","repository":{"id":80690711,"uuid":"165657735","full_name":"Greater-London-Authority/gglaplot","owner":"Greater-London-Authority","description":"Makes graphics in the GLA style using ggplot2","archived":false,"fork":false,"pushed_at":"2023-09-08T11:02:37.000Z","size":6882,"stargazers_count":17,"open_issues_count":8,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-13T23:32:20.303Z","etag":null,"topics":["ggplot2","r","visualization"],"latest_commit_sha":null,"homepage":"https://greater-london-authority.github.io/gglaplot/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Greater-London-Authority.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-14T12:28:38.000Z","updated_at":"2023-10-25T10:28:27.000Z","dependencies_parsed_at":"2024-01-17T22:13:30.402Z","dependency_job_id":"774090b9-567b-4c08-b318-039a967ca75a","html_url":"https://github.com/Greater-London-Authority/gglaplot","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Greater-London-Authority%2Fgglaplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Greater-London-Authority%2Fgglaplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Greater-London-Authority%2Fgglaplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Greater-London-Authority%2Fgglaplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Greater-London-Authority","download_url":"https://codeload.github.com/Greater-London-Authority/gglaplot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252779033,"owners_count":21802867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","r","visualization"],"created_at":"2024-08-02T23:01:20.043Z","updated_at":"2025-05-06T22:31:18.788Z","avatar_url":"https://github.com/Greater-London-Authority.png","language":"R","funding_links":[],"categories":["Themes and aesthetics"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE, fig.path = \"man/figures/\")\n```\n\n# gglaplot \u003cimg src=\"man/figures/logo.png\" align=\"right\" alt=\"\" width=\"120\" /\u003e\n\nThe package provides several wrappers and tools to use with ggplot2 and plotly to make graphics that follow the GLA [City Intelligence Data Design Guidelines](https://data.london.gov.uk/blog/city-intelligence-data-design-guidelines/).\n\n## Installation\n\n\n```{r Installation, eval=FALSE}\n# To install from github use the devtools function:\n# This will install all required dependencies\ndevtools::install_github(\"Greater-London-Authority/gglaplot\")\n```\n\n## Usage\n\n```{r Usage, message=FALSE, warning=FALSE, dpi = 300}\nlibrary(ggplot2)\nlibrary(gglaplot)\nlibrary(dplyr)\nlibrary(scales)\nlibrary(lubridate)\n\npal \u003c- gla_pal(gla_theme = \"default\", palette_type = \"highlight\", n = c(1, 1))\ntheme_set(theme_gla(gla_theme = \"default\"))\n\nplot \u003c- ggplot(data = LDNUK, mapping = aes(x = Year, y = GPG, group = location,\n                                   colour = location)) +\n  ggla_line(aes(size = location)) +\n  scale_size_manual(values = c(4 * mm_to_pt, 2 * mm_to_pt)) +\n  scale_colour_manual(values = pal) +\n  ggla_highlight(filter_type = \"end\") +\n  ggla_axisat0() +\n  scale_y_continuous(expand = c(0, 0), limits = c(0, 32.5),\n                      labels = dollar_format(prefix = \"\", suffix = \"%\")) +\n  scale_x_date(date_breaks = \"1 year\", date_labels = \"'%y\",\n               expand = expansion(mult = c(0.05, 0.01))) +\n  labs(title = \"Gender Pay Gap - Total (Median)\",\n        subtitle = \"Gender Pay Gap - Total (Median) - London VS UK\",\n        caption = \"Note: 2017 data is provisional\\nChart: GLA City Intelligence  Source: London Datastore\")\nplot\n```\n\nPlots can be incorporated in Rmarkdown/Notebooks or exported to be included in documents/slideshows etc\n\n```{r saving plot, message=FALSE, warning=FALSE, eval=FALSE}\nggsave(plot = plot, path = \"example_plot.svg\")\n```\n\n`.svg` is the best format to export plots, and the size and dpi of the output can be adjusted within `ggsave()`.\n\n\n## Getting Help\n\n### ggplot2\n\nThere are many online resources for ggplot2, including:\n\n* [ggplot2 cheatsheet](https://ggplot2.tidyverse.org/)\n* [ggplot2 documentation](https://ggplot2.tidyverse.org/reference/)\n* [DataCamp course](https://www.datacamp.com/courses/data-visualization-with-ggplot2-1)\n\n### plotly\n\n* [plotly website](https://plotly.com/r/)\n* [plotly bookdown](https://plotly-r.com/)\n\n\n### gglaplot\n\nFor help with gglaplot itself, see the vignettes which are available on the [gglaplot github pages](https://greater-london-authority.github.io/gglaplot/).\n\nThe BBC has a similar package for their house style which has some comprehensive help pages [here](https://bbc.github.io/rcookbook/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGreater-London-Authority%2Fgglaplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGreater-London-Authority%2Fgglaplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGreater-London-Authority%2Fgglaplot/lists"}