Package 'zueritheme'

Title: ggplot theme to conform to the corporate identity/design of the city of Zurich
Description: This package exports one function - ssz_theme() - to be used as a ggplot theme.
Authors: Alessandro Feller [aut, cre], Sara Hänzi [aut], Statistik Stadt Zürich [cph, fnd]
Maintainer: Alessandro Feller <[email protected]>
License: MIT + file LICENSE
Version: 1.0.1
Built: 2026-05-09 09:23:58 UTC
Source: https://github.com/StatistikStadtZuerich/zueritheme

Help Index


ssz_theme

Description

Function for styling ggplots graphs according to Stadt Zürich's corporate design.

Usage

ssz_theme(
  grid_lines = "y",
  base_size = 8.2,
  base_family = "",
  base_line_size = base_size/170,
  base_rect_size = base_size/170,
  publication_type = "print"
)

Arguments

grid_lines

specifies the axis on which to display the primary grid lines or axis lines. "y" is the default value, can be "x" or "y" for publication type "web", and "x", "y", "both", or "none" for publication_type "print".

base_size

optional, defines the base font size used throughout the plot. This parameter is passed to the ssz_theme_base and ssz_theme_base_web function, ensuring consistent typography across ggplot elements. Adjust this value to control the overall text size in the ggplot object for better readability or stylistic preference.

base_family

optional, specifies the base font family for the text elements in the ggplot object. This parameter is passed to the ssz_theme_base and ssz_theme_base_web function, ensuring a consistent font style across ggplot elements. Adjust this value to control the overall font family in the ggplot object.

base_line_size

optional, sets the base line size for lines and borders within the ggplot object. This parameter is passed to the ssz_theme_base and ssz_theme_base_web function, ensuring consistent line thickness across visual elements. Adjust this value to modify the overall line width for improved visual clarity or stylistic preferences.

base_rect_size

optional, specifies the base size for rectangular elements such as legend boxes or plot backgrounds within the ggplot object. This parameter is passed to the ssz_theme_base and ssz_theme_base_web function, ensuring consistent sizing of rectangular shapes across ggplot elements. Adjust this value to control the thickness of borders for better visual balance or customization.

publication_type

specifies the output type for with the theme is tailored. Available options are "print" and "web", with "print" as the default value. This parameter controls how visual elements like grid lines and axis formatting are adjusted to best suit the chosen publication type, ensuring optimal presentation for either print or web-based outputs.

Value

a ggplot theme.

Examples

## Not run: 
ggplot(...) +
  ssz_theme(grid_lines = "x", publication_type = "print")

## End(Not run)

ssz_theme_base

Description

Function that creates a ggplot theme that can be used as a base theme on top of which to replace the theme's items that depend on the orientation of the print plot.

Usage

ssz_theme_base(base_size, base_family, base_line_size, base_rect_size)

Arguments

base_size

optional, defines the base font size used throughout the plot. This parameter is passed to the theme_bw function, ensuring consistent typography across ggplot elements.

base_family

optional, specifies the base font family for the text elements in the ggplot object. This parameter is passed to the theme_bw function, ensuring a consistent font style across ggplot elements.

base_line_size

optional, sets the base line size for lines and borders within the ggplot object. This parameter is passed to the theme_bw function, ensuring consistent line thickness across visual elements.

base_rect_size

optional, specifies the base size for rectangular elements such as legend boxes or plot backgrounds within the ggplot object. This parameter is passed to the theme_bw function, ensuring consistent sizing of rectangular shapes across ggplot elements.

Value

a ggplot theme


ssz_theme_void

Description

Function for styling ggplots graphs according to Stadt Zürich's corporate design. Used for plots with a void theme, i.e. no grid lines and no axis texts.

Usage

ssz_theme_void(
  base_size = 8.2,
  base_family = "",
  base_line_size = base_size/170,
  base_rect_size = base_size/170
)

Arguments

base_size

optional, defines the base font size used throughout the plot. This parameter is passed to the theme_void function, ensuring consistent typography across ggplot elements. Adjust this value to control the overall text size in the ggplot object for better readability or stylistic preference.

base_family

optional, specifies the base font family for the text elements in the ggplot object. This parameter is passed to the theme_void function, ensuring a consistent font style across ggplot elements. Adjust this value to control the overall font family in the ggplot object.

base_line_size

optional, sets the base line size for lines and borders within the ggplot object. This parameter is passed to the theme_void function, ensuring consistent line thickness across visual elements. Adjust this value to $ modify the overall line width for improved visual clarity or stylistic preferences.

base_rect_size

optional, specifies the base size for rectangular elements such as legend boxes or plot backgrounds within the ggplot object. This parameter is passed to the theme_void function, ensuring consistent sizing of rectangular shapes across ggplot elements. Adjust this value to control the thickness of borders for better visual balance or customization.

Value

a void ggplot theme.

Examples

## Not run: 
ggplot(...) +
  ssz_theme_void()

## End(Not run)

ssz_theme_base_web

Description

Function that creates a ggplot theme that can be used as a base theme on top of which to replace the theme's items that depend on the orientation of the web plot.

Usage

ssz_theme_web_base(base_size, base_family, base_line_size, base_rect_size)

Arguments

base_size

optional, defines the base font size used throughout the plot. This parameter is passed to the theme_bw function, ensuring consistent typography across ggplot elements.

base_family

optional, specifies the base font family for the text elements in the ggplot object. This parameter is passed to the theme_bw function, ensuring a consistent font style across ggplot elements.

base_line_size

optional, sets the base line size for lines and borders within the ggplot object. This parameter is passed to the theme_bw function, ensuring consistent line thickness across visual elements.

base_rect_size

optional, specifies the base size for rectangular elements such as legend boxes or plot backgrounds within the ggplot object. This parameter is passed to the theme_bw function, ensuring consistent sizing of rectangular shapes across ggplot elements.

Value

a ggplot theme