zueritheme: Statistik Stadt Zurich ggplot2 theme | Read-only mirror of https://github.com/StatistikStadtZuerich/zueritheme — Stadt Zürich. Issues & pull requests at the source.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Alessandro Feller (sszfea) 0131b7e2cc Merge branch 'feature-rversion' into 'main'
Feature rversion

See merge request OE-7035/ssz-da/libraries/zueriverse/zueritheme!17
2026-02-04 17:11:52 +00:00
.github create gh action for gh pages with usethis 2025-04-25 17:23:17 +02:00
dev add font to dev plots 2024-10-09 13:33:03 +02:00
man create first version of pkgdown site 2025-04-02 17:04:59 +02:00
R linewidth instead of size in element_line 2025-12-22 11:41:33 +01:00
renv update r version 2025-12-22 11:27:46 +01:00
tests delete visual test 2026-02-04 17:02:11 +01:00
.gitignore create gh action for gh pages with usethis 2025-04-25 17:23:17 +02:00
.gitlab-ci.yml adjust pipeline to new template 2025-11-18 07:40:03 +00:00
.Rbuildignore create gh action for gh pages with usethis 2025-04-25 17:23:17 +02:00
.Rprofile create renv 2023-02-20 13:19:56 +01:00
_pkgdown.yml create gh action for gh pages with usethis 2025-04-25 17:23:17 +02:00
DESCRIPTION update description 2025-12-22 15:00:20 +01:00
LICENSE change license to mit 2025-04-02 14:55:25 +02:00
LICENSE.md change license to mit 2025-04-02 14:55:25 +02:00
NAMESPACE export ssz_theme_void 2023-08-24 13:56:32 +02:00
NEWS.md deprecated parameter 2026-02-04 17:32:41 +01:00
README.md fix email in readme, add alt text to logo 2025-04-24 13:02:25 +02:00
renv.lock update renv 2025-12-22 15:00:13 +01:00
zueritheme.Rproj initial package setup 2022-11-24 15:11:57 +01:00

Hexagon logo for zueritheme R package

zueritheme

CRAN status R-CMD-check GitLab Pipeline

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.

For detailed instructions on how to create correctly styled plots (for print), check out the zueriplots repository.

Getting Help

If you encounter a bug, please contact statistik@zuerich.ch.