| Title: | HSCI ggplot2 theme |
|---|---|
| Description: | ggplot2 theme used by the Human Sciences -- Computing Interaction research group at the University of Helsinki. |
| Authors: | Eetu Mäkelä |
| Maintainer: | Eetu Mäkelä <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.2.2 |
| Built: | 2026-06-06 10:11:42 UTC |
| Source: | https://github.com/hsci-r/gghsci |
extract the coloropt final neutral gray value for different palettes
coloropt_na_value(n, option = "normal")coloropt_na_value(n, option = "normal")
n |
the number of colors required from the palette (max 13 for normal, 7 for the other palettes) |
option |
coloropt palette from normal, bright, dark, fancy and tarnish |
coloropt palette
coloropt_pal(option = "normal")coloropt_pal(option = "normal")
option |
coloropt palette from normal, bright, dark, fancy and tarnish |
convert a palette to grayscale
convert_palette_to_grayscale(palette)convert_palette_to_grayscale(palette)
palette |
palette to convert |
Save plots to PNG + SVG files
save_plots(dir, basename, plot, width = 6, height = 5, units = "in", dpi = 300)save_plots(dir, basename, plot, width = 6, height = 5, units = "in", dpi = 300)
dir |
directory to save the plots to |
basename |
the base name for the plot files |
plot |
the plot to save |
width |
plot width |
height |
plot height |
units |
the units in which width & height are measured |
dpi |
plot resolution (dots per inch) |
coloropt discrete color/fill scale
scale_coloropt(..., option = "normal", aesthetics = c("colour", "fill"))scale_coloropt(..., option = "normal", aesthetics = c("colour", "fill"))
... |
Arguments passed on to
|
option |
coloropt palette from normal, bright, dark, fancy and tarnish |
aesthetics |
Character string or vector of character strings listing the
name(s) of the aesthetic(s) that this scale works with. This can be useful, for
example, to apply colour settings to the |
grayscale version of the coloropt palette
scale_coloropt_grayscale( ..., option = "normal", aesthetics = c("colour", "fill") )scale_coloropt_grayscale( ..., option = "normal", aesthetics = c("colour", "fill") )
... |
Arguments passed on to
|
option |
coloropt palette from normal, bright, dark, fancy and tarnish |
aesthetics |
Character string or vector of character strings listing the
name(s) of the aesthetic(s) that this scale works with. This can be useful, for
example, to apply colour settings to the |
grayscale version of the continuous viridis palette
scale_viridis_c_grayscale( ..., alpha = 1, begin = 0, end = 1, direction = 1, option = "D", values = NULL, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = c("colour", "fill") )scale_viridis_c_grayscale( ..., alpha = 1, begin = 0, end = 1, direction = 1, option = "D", values = NULL, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = c("colour", "fill") )
... |
Other arguments passed on to |
alpha |
The alpha transparency, a number in [0,1], see argument alpha in
|
begin, end
|
The (corrected) hue in |
direction |
Sets the order of colors in the scale. If 1, the default, colors are ordered from darkest to lightest. If -1, the order of colors is reversed. |
option |
A character string indicating the color map option to use. Eight options are available:
|
values |
if colours should not be evenly positioned along the gradient
this vector gives the position (between 0 and 1) for each colour in the
|
space |
colour space in which to calculate gradient. Must be "Lab" - other values are deprecated. |
na.value |
Missing values will be replaced with this value. |
guide |
A function used to create a guide or its name. See
|
aesthetics |
Character string or vector of character strings listing the
name(s) of the aesthetic(s) that this scale works with. This can be useful, for
example, to apply colour settings to the |
ggplot2::scale_colour_viridis_c
HSCI ggplot theme
theme_hsci(base_size = 12, base_family = "sans")theme_hsci(base_size = 12, base_family = "sans")
base_size |
base font size, given in pts. |
base_family |
base font family |
HSCI ggplot theme with viridis continuous palette
theme_hsci_continuous( base_size = 12, base_family = "sans", palette = "viridis" )theme_hsci_continuous( base_size = 12, base_family = "sans", palette = "viridis" )
base_size |
base font size, given in pts. |
base_family |
base font family |
palette |
viridis palette to use. Four options are available: "magma" (or "A"), "inferno" (or "B"), "plasma" (or "C"), "viridis" (or "D", the default option) and "cividis" (or "E"). |
HSCI ggplot theme with grayscale viridis continuous palette
theme_hsci_continuous_grayscale( base_size = 12, base_family = "sans", palette = "viridis" )theme_hsci_continuous_grayscale( base_size = 12, base_family = "sans", palette = "viridis" )
base_size |
base font size, given in pts. |
base_family |
base font family |
palette |
viridis palette to use. Four options are available: "magma" (or "A"), "inferno" (or "B"), "plasma" (or "C"), "viridis" (or "D", the default option) and "cividis" (or "E"). |
HSCI ggplot theme with a discrete coloropt palette.
theme_hsci_discrete(base_size = 12, base_family = "sans", palette = "normal")theme_hsci_discrete(base_size = 12, base_family = "sans", palette = "normal")
base_size |
base font size, given in pts. |
base_family |
base font family |
palette |
coloropt palette from normal, bright, dark, fancy and tarnish |
HSCI ggplot theme with a grayscale coloropt discrete palette.
theme_hsci_discrete_grayscale( base_size = 12, base_family = "sans", palette = "normal" )theme_hsci_discrete_grayscale( base_size = 12, base_family = "sans", palette = "normal" )
base_size |
base font size, given in pts. |
base_family |
base font family |
palette |
coloropt palette from normal, bright, dark, fancy and tarnish |