theme_clean: A clean alternative theme for ggplot2.

View source: R/theme_fun.R

theme_cleanR Documentation

A clean alternative theme for ggplot2.

Description

theme_clean provides an alternative ds4psy theme to use in ggplot2 commands.

Usage

theme_clean(
  base_size = 11,
  base_family = "",
  base_line_size = base_size/22,
  base_rect_size = base_size/22,
  col_title = grey(0, 1),
  col_panel = grey(0.85, 1),
  col_gridx = grey(1, 1),
  col_gridy = grey(1, 1),
  col_ticks = grey(0.1, 1)
)

Arguments

base_size

Base font size (optional, numeric). Default: base_size = 11.

base_family

Base font family (optional, character). Default: base_family = "". Options include "mono", "sans" (default), and "serif".

base_line_size

Base line size (optional, numeric). Default: base_line_size = base_size/22.

base_rect_size

Base rectangle size (optional, numeric). Default: base_rect_size = base_size/22.

col_title

Color of plot title (and tag). Default: col_title = grey(.0, 1) (i.e., "black").

col_panel

Color of panel background(s). Default: col_panel = grey(.85, 1) (i.e., light "grey").

col_gridx

Color of (major) panel lines (through x/vertical). Default: col_gridx = grey(1.0, 1) (i.e., "white").

col_gridy

Color of (major) panel lines (through y/horizontal). Default: col_gridy = grey(1.0, 1) (i.e., "white").

col_ticks

Color of axes text and ticks. Default: col_ticks = grey(.10, 1) (i.e., near "black").

Details

theme_clean is more minimal than theme_ds4psy and fills panel backgrounds with a color col_panel.

This theme works well for plots with multiple panels, strong colors and bright color accents, but is of limited use with transparent colors.

Value

A ggplot2 theme.

See Also

theme_ds4psy for default theme.

Other plot functions: plot_charmap(), plot_chars(), plot_fn(), plot_fun(), plot_n(), plot_text(), plot_tiles(), theme_ds4psy(), theme_empty()

Examples



# Plotting iris dataset (using ggplot2, theme_grau, and unikn colors):
  
library('ggplot2')  # theme_clean() requires ggplot2
library('unikn')    # for colors and usecol() function
   
ggplot(datasets::iris) +
  geom_jitter(aes(x = Sepal.Length, y = Sepal.Width, color = Species), size = 3, alpha = 3/4) +
  facet_wrap(~Species) +
  scale_color_manual(values = usecol(pal = c(Pinky, Karpfenblau, Seegruen))) +
  labs(tag = "B",
       title = "Iris sepals",
       caption = "Data from datasets::iris") + 
  coord_fixed(ratio = 3/2) + 
  theme_clean()




ds4psy documentation built on Sept. 15, 2023, 9:08 a.m.