Greater-London-Authority / gglaplot

Licence: other
Makes graphics in the GLA style using ggplot2

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to gglaplot

Calendr
Ready to print calendars with ggplot2
Stars: ✭ 161 (+973.33%)
Mutual labels:  ggplot2
Ggdist
Visualizations of distributions and uncertainty
Stars: ✭ 197 (+1213.33%)
Mutual labels:  ggplot2
R4ds Exercise Solutions
Exercise solutions to "R for Data Science"
Stars: ✭ 226 (+1406.67%)
Mutual labels:  ggplot2
Plotly
An interactive graphing library for R
Stars: ✭ 2,096 (+13873.33%)
Mutual labels:  ggplot2
Ggnet
Network visualization with ggplot2
Stars: ✭ 182 (+1113.33%)
Mutual labels:  ggplot2
Gggenes
➡️️➡️️⬅️️➡️️ Draw gene arrow maps in ggplot2
Stars: ✭ 214 (+1326.67%)
Mutual labels:  ggplot2
Patchwork
The Composer of ggplots
Stars: ✭ 2,002 (+13246.67%)
Mutual labels:  ggplot2
ggplotify
ggplot everything
Stars: ✭ 89 (+493.33%)
Mutual labels:  ggplot2
Treemapify
🌳 Draw treemaps in ggplot2
Stars: ✭ 186 (+1140%)
Mutual labels:  ggplot2
Ghibli
Studio Ghibli colour palettes
Stars: ✭ 227 (+1413.33%)
Mutual labels:  ggplot2
Slopegraph
Edward Tufte-Inspired Slopegraphs
Stars: ✭ 166 (+1006.67%)
Mutual labels:  ggplot2
Gghalves
✂️ Easy half-half geoms in ggplot2
Stars: ✭ 174 (+1060%)
Mutual labels:  ggplot2
Vaporwave
📼👾🕹Vaporwave themes and color palettes for ggplot2💾👨‍🎤📺
Stars: ✭ 215 (+1333.33%)
Mutual labels:  ggplot2
Gglabeller
Shiny gadget for labeling points on ggplot
Stars: ✭ 161 (+973.33%)
Mutual labels:  ggplot2
Ggfittext
🔠 ggplot2 geoms to fit text into boxes
Stars: ✭ 233 (+1453.33%)
Mutual labels:  ggplot2
Econocharts
Microeconomics/macroeconomics charts in ggplot2
Stars: ✭ 161 (+973.33%)
Mutual labels:  ggplot2
Ggcharts
Get You to Your Desired Plot Faster
Stars: ✭ 205 (+1266.67%)
Mutual labels:  ggplot2
schoenberg
ggplot-based graphics and useful functions for GAMs fitted using the mgcv package
Stars: ✭ 25 (+66.67%)
Mutual labels:  ggplot2
ggplot2 themes in github
A generated list of repos containing themes/styles for ggplot2
Stars: ✭ 43 (+186.67%)
Mutual labels:  ggplot2
Ggedit
Interactively edit ggplot layer aesthetics and theme definitions
Stars: ✭ 223 (+1386.67%)
Mutual labels:  ggplot2

gglaplot

The package provides several wrappers and tools to use with ggplot2 and plotly to make graphics that follow the GLA City Intelligence Data Design Guidelines.

Installation

# To install from github use the devtools function:
# This will install all required dependencies
devtools::install_github("Greater-London-Authority/gglaplot")

Usage

library(ggplot2)
library(gglaplot)
library(dplyr)
library(scales)
library(lubridate)

pal <- gla_pal(gla_theme = "default", palette_type = "highlight", n = c(1, 1))
theme_set(theme_gla(gla_theme = "default"))

plot <- ggplot(data = LDNUK, mapping = aes(x = Year, y = GPG, group = location,
                                   colour = location)) +
  ggla_line(aes(size = location)) +
  scale_size_manual(values = c(4 * mm_to_pt, 2 * mm_to_pt)) +
  scale_colour_manual(values = pal) +
  ggla_highlight(filter_type = "end") +
  ggla_axisat0() +
  scale_y_continuous(expand = c(0, 0), limits = c(0, 32.5),
                      labels = dollar_format(prefix = "", suffix = "%")) +
  scale_x_date(date_breaks = "1 year", date_labels = "'%y",
               expand = expansion(mult = c(0.05, 0.01))) +
  labs(title = "Gender Pay Gap - Total (Median)",
        subtitle = "Gender Pay Gap - Total (Median) - London VS UK",
        caption = "Note: 2017 data is provisional\nChart: GLA City Intelligence  Source: London Datastore")
plot

Plots can be incorporated in Rmarkdown/Notebooks or exported to be included in documents/slideshows etc

ggsave(plot = plot, path = "example_plot.svg")

.svg is the best format to export plots, and the size and dpi of the output can be adjusted within ggsave().

Getting Help

ggplot2

There are many online resources for ggplot2, including:

plotly

gglaplot

For help with gglaplot itself, see the vignettes which are available on the gglaplot github pages.

The BBC has a similar package for their house style which has some comprehensive help pages here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].