Skip to content

StatistikStadtZuerich/zueritheme

Repository files navigation

zueritheme

zueritheme is an R-Package, which provides a ggplot2 theme that conforms to the corporate design of the city of Zurich. zueritheme's main function ssz_theme(...) provides most of the styling. However, in order for ggplot2 graphs to fully conform to the corporate design, a few manual steps are still necessary. These steps are explained in further detail in the zueriplots repository. You can find CI/CD conform color palettes in the zuericolors package.

Installation

The easiest way to get zueritheme is to install it from this repo:

# install.packages("devtools")
devtools::install_github("StatistikStadtZuerich/zueritheme")

Alternatively, download the files (by clicking 'Clone or download' / 'Download Zip'), extract it to any location on your computer, e.g. to your Desktop and then run:

remotes::install_local("<path_to_location>/zueritheme-main")

Version

To check your version of zueritheme, run:

packageVersion("zueritheme")

Example

This is an example which shows you how to set the ssz_theme as your general ggplot theme:

library(zueritheme)
library(ggplot2)
theme_set(ssz_theme())

Alternatively, you can add the theme to a ggplot directly:

library(zueritheme)
library(ggplot2)
ggplot(...) +
    ... +
    ssz_theme(publication_type  = "print", grid_lines = "x")

With the release of version 0.0.2 of zueritheme, a new function parameter named publication_type has been added, allowing for different styling options specifically for web-based ggplots, such as those generated with ggiraph.

Getting Help

If you encounter a bug, please contact [email protected]{.email}.

About

zueritheme: Statistik Stadt Zurich ggplot2 theme

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages