Title: | Themes for ggplot2 |
---|---|
Description: | Several themes for the ggplot2 package. Among others themes complying with the style guide for the Research Institute for Nature and Forest (INBO) and Elsevier journals. |
Authors: | Thierry Onkelinx [aut, cre] , Oona Op de Weerdt [ctb], Nicole De Groof [ctb] , Research Institute for Nature and Forest (INBO) [cph, fnd] |
Maintainer: | Thierry Onkelinx <[email protected]> |
License: | GPL-3 |
Version: | 0.6.0 |
Built: | 2024-11-16 04:37:18 UTC |
Source: | https://github.com/inbo/inbotheme |
The function calculates the distance matrices for every option. Then aggregates the matrices into a single distance matrix.
colour_blind_distance( colours, deutan = TRUE, protan = FALSE, tritan = FALSE, gray = FALSE, fun = min, method = "emd" )
colour_blind_distance( colours, deutan = TRUE, protan = FALSE, tritan = FALSE, gray = FALSE, fun = min, method = "emd" )
colours |
a vector of colours |
deutan |
correct for deuteranomaly (red - green colour blindness).
Defaults to |
protan |
correct for protanopia (red - green colour blindness).
Defaults to |
tritan |
correct for tritanopia (blue - yellow colour blindness).
Defaults to |
gray |
correct for monochromacy (unable to distinguish colours).
Defaults to |
fun |
Function to aggregate different colour distance matrices. |
method |
passed to |
Calculate a distance matrix between colours
colour_distance(colours, method = "emd")
colour_distance(colours, method = "emd")
colours |
a vector of colours |
method |
passed to |
Create an image with a number of rectangles coloured along the input vector.
demo_palette(colours)
demo_palette(colours)
colours |
a vector of colours |
Other colours:
inbo_hoofd
,
inbo_palette()
,
nara_palette()
,
show_palette()
,
traffic_palette()
,
vl_yellow
,
vlaanderen_palette()
Colour according to the INBO style guide as hexadecimal values.
inbo_hoofd
inbo_steun_donkerroos
inbo_steun_blauw
inbo_steun_geelgroen
inbo_oranje
inbo_rood
inbo_bruinrood
inbo_grijs
inbo_lichtgrijs
inbo_grijsblauw
inbo_lichtblauw
inbo_achtergrond
inbo_munt
inbo_lichtgroen
inbo_donkergroen
inbo_groen
inbo_geelgr
inbo_oranje
inbo_geel
inbo_felrood
inbo_groen
inbo_kaki
inbo_oranjerood
inbo_donkerblauw
Thierry Onkelinx, Oona Op de Weerdt, Nicole De Groof
theme_inbo2015()
Other colours:
demo_palette()
,
inbo_palette()
,
nara_palette()
,
show_palette()
,
traffic_palette()
,
vl_yellow
,
vlaanderen_palette()
A Colour Palette According the INBO Style Guide Version >= 2015.
inbo_palette(n)
inbo_palette(n)
n |
The number of colours |
a vector of n hexadecimal values defining the colours.
Thierry Onkelinx, Oona Op de Weerdt, Nicole De Groof
Other colours:
demo_palette()
,
inbo_hoofd
,
nara_palette()
,
show_palette()
,
traffic_palette()
,
vl_yellow
,
vlaanderen_palette()
These functions will be removed from INBOtheme
in the future.
inbo.2015.colours(n) switchColour(new_colour = inbo_steun_blauw) vlaanderen.2015.colours(n)
inbo.2015.colours(n) switchColour(new_colour = inbo_steun_blauw) vlaanderen.2015.colours(n)
n |
The number of colours |
new_colour |
The new default colour. |
Deprecated.
Use inbo_palette()
instead.
nara_palette(n)
nara_palette(n)
n |
The number of colours |
a vector of n hexadecimal values defining the colours.
Other colours:
demo_palette()
,
inbo_hoofd
,
inbo_palette()
,
show_palette()
,
traffic_palette()
,
vl_yellow
,
vlaanderen_palette()
Start with variable which has the largest distance between all other variables. Then add the variable with the largest distance to the already selected variables.
optimal_order(distance, selected = character(0))
optimal_order(distance, selected = character(0))
distance |
a square distance matrix |
selected |
optional vector of preselected variables |
a vector variable names
The colour ramps depends on the active ggplot2
theme.
ordinal_palette(n)
ordinal_palette(n)
n |
The number of colours |
Several standard dimensions for the Elsevier style guide
-page_height
Maximal height of a figure (in inch).
-page_width
Width of a figure covering two columns (in inch).
-column_width
Width of a figure covering one column (in inch).
-medium_width
Width of a figure covering 1.5 columns (in inch).
theme_elsevier()
ggplot2::scale_colour_discrete()
Selects the colours depending on the current set theme.
scale_colour_discrete(..., type) scale_color_discrete(..., type)
scale_colour_discrete(..., type) scale_color_discrete(..., type)
... |
Additional parameters passed on to the scale type, |
type |
Ignored argument.
Only present to match the arguments of |
Thierry Onkelinx, Oona Op de Weerdt, Nicole De Groof
Other scales:
scale_colour_gradient2()
,
scale_colour_gradient()
,
scale_colour_viridis_d()
,
scale_fill_discrete()
,
scale_fill_gradient2()
,
scale_fill_gradient()
ggplot2::scale_colour_gradient()
Selects the colours depending on the current set theme.
scale_colour_gradient( ..., low, high, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "colour" ) scale_color_gradient( ..., low, high, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "colour" )
scale_colour_gradient( ..., low, high, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "colour" ) scale_color_gradient( ..., low, high, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "colour" )
... |
Arguments passed on to
|
low |
Colour for the low end of the gradient |
high |
Colour for the high end of the gradient |
space |
colour space in which to calculate gradient. Must be "Lab" - other values are deprecated. |
na.value |
Colour to use for missing values |
guide |
Type of legend. Use |
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 |
Thierry Onkelinx, Oona Op de Weerdt, Nicole De Groof
Other scales:
scale_colour_discrete()
,
scale_colour_gradient2()
,
scale_colour_viridis_d()
,
scale_fill_discrete()
,
scale_fill_gradient2()
,
scale_fill_gradient()
ggplot2::scale_colour_gradient2()
Selects the colours depending on the current set theme.
scale_colour_gradient2( ..., low, high, mid, midpoint = 0, space = "Lab", guide = "colourbar", na.value = "grey50", aesthetics = "colour" ) scale_color_gradient2( ..., low, high, mid, midpoint = 0, space = "Lab", guide = "colourbar", na.value = "grey50", aesthetics = "colour" )
scale_colour_gradient2( ..., low, high, mid, midpoint = 0, space = "Lab", guide = "colourbar", na.value = "grey50", aesthetics = "colour" ) scale_color_gradient2( ..., low, high, mid, midpoint = 0, space = "Lab", guide = "colourbar", na.value = "grey50", aesthetics = "colour" )
... |
Arguments passed on to
|
low |
Colour for the low end of the gradient |
high |
Colour for the high end of the gradient |
mid |
colour for mid point |
midpoint |
The midpoint (in data value) of the diverging scale. Defaults to 0. |
space |
colour space in which to calculate gradient. Must be "Lab" - other values are deprecated. |
guide |
Type of legend. Use |
na.value |
Colour to use for missing values |
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 |
Thierry Onkelinx, Oona Op de Weerdt, Nicole De Groof
Other scales:
scale_colour_discrete()
,
scale_colour_gradient()
,
scale_colour_viridis_d()
,
scale_fill_discrete()
,
scale_fill_gradient2()
,
scale_fill_gradient()
ggplot2::scale_colour_viridis_d()
Selects the colours depending on the current set theme.
scale_colour_viridis_d( ..., alpha = 1, begin = 0, end = 1, direction = 1, option = "D", aesthetics = "colour" ) scale_fill_viridis_d( ..., alpha = 1, begin = 0, end = 1, direction = 1, option = "D", aesthetics = "fill" )
scale_colour_viridis_d( ..., alpha = 1, begin = 0, end = 1, direction = 1, option = "D", aesthetics = "colour" ) scale_fill_viridis_d( ..., alpha = 1, begin = 0, end = 1, direction = 1, option = "D", aesthetics = "fill" )
... |
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:
|
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 |
Thierry Onkelinx, Oona Op de Weerdt, Nicole De Groof
Other scales:
scale_colour_discrete()
,
scale_colour_gradient2()
,
scale_colour_gradient()
,
scale_fill_discrete()
,
scale_fill_gradient2()
,
scale_fill_gradient()
Other scales:
scale_colour_discrete()
,
scale_colour_gradient2()
,
scale_colour_gradient()
,
scale_fill_discrete()
,
scale_fill_gradient2()
,
scale_fill_gradient()
ggplot2::scale_fill_discrete()
Selects the colours depending on the current set theme.
scale_fill_discrete(..., type)
scale_fill_discrete(..., type)
... |
Additional parameters passed on to the scale type, |
type |
One of the following:
|
Thierry Onkelinx, Oona Op de Weerdt, Nicole De Groof
Other scales:
scale_colour_discrete()
,
scale_colour_gradient2()
,
scale_colour_gradient()
,
scale_colour_viridis_d()
,
scale_fill_gradient2()
,
scale_fill_gradient()
ggplot2::scale_fill_gradient()
Selects the colours depending on the current set theme.
scale_fill_gradient( ..., low, high, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "fill" )
scale_fill_gradient( ..., low, high, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "fill" )
... |
Arguments passed on to
|
low |
Colour for the low end of the gradient |
high |
Colour for the high end of the gradient |
space |
colour space in which to calculate gradient. Must be "Lab" - other values are deprecated. |
na.value |
Colour to use for missing values |
guide |
Type of legend. Use |
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 |
Thierry Onkelinx, Oona Op de Weerdt, Nicole De Groof
Other scales:
scale_colour_discrete()
,
scale_colour_gradient2()
,
scale_colour_gradient()
,
scale_colour_viridis_d()
,
scale_fill_discrete()
,
scale_fill_gradient2()
ggplot2::scale_fill_gradient2()
Selects the colours depending on the current set theme.
scale_fill_gradient2( ..., low, high, mid, midpoint = 0, space = "Lab", guide = "colourbar", na.value = "grey50", aesthetics = "fill" )
scale_fill_gradient2( ..., low, high, mid, midpoint = 0, space = "Lab", guide = "colourbar", na.value = "grey50", aesthetics = "fill" )
... |
Arguments passed on to
|
low |
Colour for the low end of the gradient |
high |
Colour for the high end of the gradient |
mid |
colour for mid point |
midpoint |
The midpoint (in data value) of the diverging scale. Defaults to 0. |
space |
colour space in which to calculate gradient. Must be "Lab" - other values are deprecated. |
guide |
Type of legend. Use |
na.value |
Colour to use for missing values |
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 |
Thierry Onkelinx, Oona Op de Weerdt, Nicole De Groof
Other scales:
scale_colour_discrete()
,
scale_colour_gradient2()
,
scale_colour_gradient()
,
scale_colour_viridis_d()
,
scale_fill_discrete()
,
scale_fill_gradient()
Show a palette on a single row
show_palette(colours)
show_palette(colours)
colours |
a vector of colours |
Other colours:
demo_palette()
,
inbo_hoofd
,
inbo_palette()
,
nara_palette()
,
traffic_palette()
,
vl_yellow
,
vlaanderen_palette()
ggplot2
geoms
.Switch the default colour of all ggplot2
geoms
.
switch_colour(new_colour = inbo_steun_blauw)
switch_colour(new_colour = inbo_steun_blauw)
new_colour |
The new default colour. |
Other theme:
theme_elsevier()
,
theme_inbo()
,
theme_map()
,
theme_nara()
,
theme_vlaanderen2015()
switch_colour("black")
switch_colour("black")
This theme is based on http://cdn.elsevier.com/assets/pdf_file/0010/109963/Artwork.pdf
theme_elsevier(base_size = 7, base_family = "")
theme_elsevier(base_size = 7, base_family = "")
base_size |
base font size |
base_family |
base font type |
Other theme:
switch_colour()
,
theme_inbo()
,
theme_map()
,
theme_nara()
,
theme_vlaanderen2015()
library(ggplot2) p <- ggplot(mtcars, aes(x = mpg, y = drat)) + geom_point() p.elsevier <- p + theme_elsevier()
library(ggplot2) p <- ggplot(mtcars, aes(x = mpg, y = drat)) + geom_point() p.elsevier <- p + theme_elsevier()
The theme in compliance with the INBO style guide version >= 2015.
theme_inbo(base_size = 12, base_family = "", transparent = FALSE) theme_inbo2015(base_size = 12, base_family, transparent = FALSE)
theme_inbo(base_size = 12, base_family = "", transparent = FALSE) theme_inbo2015(base_size = 12, base_family, transparent = FALSE)
base_size |
base font size, given in pts. |
base_family |
base font family |
transparent |
Make backgrounds transparent.
|
Thierry Onkelinx, Oona Op de Weerdt, Nicole De Groof
Other theme:
switch_colour()
,
theme_elsevier()
,
theme_map()
,
theme_nara()
,
theme_vlaanderen2015()
library(ggplot2) p <- ggplot(mtcars, aes(x = mpg, y = drat)) + geom_point() p.inbo <- p + theme_inbo()
library(ggplot2) p <- ggplot(mtcars, aes(x = mpg, y = drat)) + geom_point() p.inbo <- p + theme_inbo()
ggplot2
theme which removes labels, ticks and titles from both axes.a ggplot2
theme which removes labels, ticks and titles from both axes.
theme_map()
theme_map()
Other theme:
switch_colour()
,
theme_elsevier()
,
theme_inbo()
,
theme_nara()
,
theme_vlaanderen2015()
library(ggplot2) p <- ggplot(mtcars, aes(x = mpg, y = drat)) + geom_point() p.map <- p + theme_map()
library(ggplot2) p <- ggplot(mtcars, aes(x = mpg, y = drat)) + geom_point() p.map <- p + theme_map()
Deprecated.
Use theme_inbo()
instead.
theme_nara(base_size = 12, base_family = "")
theme_nara(base_size = 12, base_family = "")
base_size |
base font size, given in pts. |
base_family |
base font family |
Other theme:
switch_colour()
,
theme_elsevier()
,
theme_inbo()
,
theme_map()
,
theme_vlaanderen2015()
The theme in compliance with the Flanders style guide version >= 2015.
theme_vlaanderen2015(base_size = 12, base_family = "", transparent = FALSE)
theme_vlaanderen2015(base_size = 12, base_family = "", transparent = FALSE)
base_size |
base font size, given in pts. |
base_family |
base font family |
transparent |
Make backgrounds transparent.
|
Thierry Onkelinx, Nicole De Groof
Other theme:
switch_colour()
,
theme_elsevier()
,
theme_inbo()
,
theme_map()
,
theme_nara()
library(ggplot2) p <- ggplot(mtcars, aes(x = mpg, y = drat)) + geom_point() p.vl <- p + theme_vlaanderen2015()
library(ggplot2) p <- ggplot(mtcars, aes(x = mpg, y = drat)) + geom_point() p.vl <- p + theme_vlaanderen2015()
A Colour Palette Ranging From a Dark Red over Medium Orange to Light Green.
traffic_palette(n)
traffic_palette(n)
n |
The number of colours |
a vector of n hexadecimal values defining the colours.
Other colours:
demo_palette()
,
inbo_hoofd
,
inbo_palette()
,
nara_palette()
,
show_palette()
,
vl_yellow
,
vlaanderen_palette()
Colour according to the Flanders style guide as hexadecimal values.
vl_yellow
vl_darkyellow
vl_black
vl_grey1
vl_grey2
vl_grey3
vl_grey4
vl_grey5
vl_grey6
vl_grey7
vl_lightgreen
vl_darkgreen
vl_lightblue
vl_darkblue
vl_lightred
vl_darkred
vl_lightbrown
vl_darkbrown
Thierry Onkelinx
http://webstijlgids.vlaanderen.be/element/kleurgebruik
Other colours:
demo_palette()
,
inbo_hoofd
,
inbo_palette()
,
nara_palette()
,
show_palette()
,
traffic_palette()
,
vlaanderen_palette()
A colour pallet according the Flanders style guide version >= 2015.
vlaanderen_palette(n)
vlaanderen_palette(n)
n |
The number of colours |
a vector of n hexadecimal values defining the colours.
Thierry Onkelinx
http://webstijlgids.vlaanderen.be/element/kleurgebruik
Other colours:
demo_palette()
,
inbo_hoofd
,
inbo_palette()
,
nara_palette()
,
show_palette()
,
traffic_palette()
,
vl_yellow