Title: | Model Visualisation Toolbox for 'easystats' and 'ggplot2' |
---|---|
Description: | Provides plotting utilities supporting packages in the 'easystats' ecosystem (<https://github.com/easystats/easystats>) and some extra themes, geoms, and scales for 'ggplot2'. Color scales are based on <https://materialui.co/>. References: Lüdecke et al. (2021) <doi:10.21105/joss.03393>. |
Authors: | Daniel Lüdecke [aut, ctb] , Dominique Makowski [aut, inv] , Indrajeet Patil [aut, cre] , Mattan S. Ben-Shachar [aut, ctb] , Brenton M. Wiernik [aut, ctb] , Philip Waggoner [aut, ctb] , Jeffrey R. Stevens [ctb] , Matthew Smith [rev] (@SmithMatt90), Jakob Bossek [rev] |
Maintainer: | Indrajeet Patil <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.9.0.9 |
Built: | 2024-11-17 08:29:22 UTC |
Source: | https://github.com/easystats/see |
The data_plot()
function usually stores information (such as title, axes
labels, etc.) as attributes, while add_plot_attributes()
adds this
information to the plot.
add_plot_attributes(x)
add_plot_attributes(x)
x |
An object. |
library(rstanarm) library(bayestestR) library(see) library(ggplot2) model <- suppressWarnings(stan_glm( Sepal.Length ~ Petal.Width + Species + Sepal.Width, data = iris, chains = 2, iter = 200, refresh = 0 )) result <- bayestestR::hdi(model, ci = c(0.5, 0.75, 0.9, 0.95)) data <- data_plot(result, data = model) p <- ggplot( data, aes(x = x, y = y, height = height, group = y, fill = fill) ) + ggridges::geom_ridgeline_gradient() p p + add_plot_attributes(data)
library(rstanarm) library(bayestestR) library(see) library(ggplot2) model <- suppressWarnings(stan_glm( Sepal.Length ~ Petal.Width + Species + Sepal.Width, data = iris, chains = 2, iter = 200, refresh = 0 )) result <- bayestestR::hdi(model, ci = c(0.5, 0.75, 0.9, 0.95)) data <- data_plot(result, data = model) p <- ggplot( data, aes(x = x, y = y, height = height, group = y, fill = fill) ) + ggridges::geom_ridgeline_gradient() p p + add_plot_attributes(data)
Can be used to get the hex code of specific colors from the blue-brown color palette.
Use bluebrown_colors()
to see all available colors.
bluebrown_colors(...)
bluebrown_colors(...)
... |
Character names of colors. |
A character vector with color-codes.
bluebrown_colors() bluebrown_colors("blue", "brown")
bluebrown_colors() bluebrown_colors("blue", "brown")
Add a radar coordinate system useful for radar charts.
coord_radar(theta = "x", start = 0, direction = 1, ...)
coord_radar(theta = "x", start = 0, direction = 1, ...)
theta |
variable to map angle to ( |
start |
Offset of starting point from 12 o'clock in radians. Offset
is applied clockwise or anticlockwise depending on value of |
direction |
1, clockwise; -1, anticlockwise |
... |
Other arguments to be passed to |
library(ggplot2) # Create a radar/spider chart with ggplot: data(iris) data <- aggregate(iris[-5], list(Species = iris$Species), mean) data <- datawizard::data_to_long( data, c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width") ) ggplot(data, aes(x = name, y = value, color = Species, group = Species)) + geom_polygon(fill = NA, linewidth = 2) + coord_radar(start = -pi / 4)
library(ggplot2) # Create a radar/spider chart with ggplot: data(iris) data <- aggregate(iris[-5], list(Species = iris$Species), mean) data <- datawizard::data_to_long( data, c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width") ) ggplot(data, aes(x = name, y = value, color = Species, group = Species)) + geom_polygon(fill = NA, linewidth = 2) + coord_radar(start = -pi / 4)
data_plot()
extracts and transforms an object for plotting,
while plot()
visualizes results of functions from different packages in
easystats-project. See the documentation
for your object's class:
data_plot(x, ...) ## S3 method for class 'compare_performance' data_plot(x, data = NULL, ...)
data_plot(x, ...) ## S3 method for class 'compare_performance' data_plot(x, data = NULL, ...)
x |
An object. |
... |
Arguments passed to or from other methods. |
data |
The original data used to create this object. Can be a statistical model. |
data_plot()
is in most situation not needed when the purpose
is plotting, since most plot()
-functions in see internally call
data_plot()
to prepare the data for plotting.
Many plot()
-functions have a data
-argument that is needed when
the data or model for plotting can't be retrieved via data_plot()
. In
such cases, plot()
gives an error and asks for providing data or models.
Most plot()
-functions work out-of-the-box, i.e. you don't need to do much
more than calling plot(<object>)
(see 'Examples'). Some plot-functions
allow to specify arguments to modify the transparency or color of geoms,
these are shown in the 'Usage' section.
library(bayestestR) library(rstanarm) model <<- suppressWarnings(stan_glm( Sepal.Length ~ Petal.Width * Species, data = iris, chains = 2, iter = 200, refresh = 0 )) x <- rope(model, verbose = FALSE) plot(x) x <- hdi(model) plot(x) + theme_modern() x <- p_direction(model, verbose = FALSE) plot(x) model <<- suppressWarnings(stan_glm( mpg ~ wt + gear + cyl + disp, chains = 2, iter = 200, refresh = 0, data = mtcars )) x <- equivalence_test(model, verbose = FALSE) plot(x)
library(bayestestR) library(rstanarm) model <<- suppressWarnings(stan_glm( Sepal.Length ~ Petal.Width * Species, data = iris, chains = 2, iter = 200, refresh = 0 )) x <- rope(model, verbose = FALSE) plot(x) x <- hdi(model) plot(x) + theme_modern() x <- p_direction(model, verbose = FALSE) plot(x) model <<- suppressWarnings(stan_glm( mpg ~ wt + gear + cyl + disp, chains = 2, iter = 200, refresh = 0, data = mtcars )) x <- equivalence_test(model, verbose = FALSE) plot(x)
Can be used to get the hex code of specific colors from the Flat UI color
palette. Use flat_colors()
to see all available colors.
flat_colors(...)
flat_colors(...)
... |
Character names of colors. |
A character vector with color-codes.
flat_colors() flat_colors("dark red", "teal")
flat_colors() flat_colors("dark red", "teal")
y
variablesAdd dot-densities for binary y
variables
geom_binomdensity(data, x, y, scale = "auto", ...)
geom_binomdensity(data, x, y, scale = "auto", ...)
data |
A dataframe. |
x , y
|
Characters corresponding to the x and y axis. Note that |
scale |
Character specifying method of scaling the dot-densities. Can
be: |
... |
Other arguments passed to |
library(ggplot2) library(see) data <- iris[1:100, ] ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", fill = "red", color = NA ) # Different scales data[1:70, "Species"] <- "setosa" # Create unbalanced proportions ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = "auto") ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = "density") ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = "proportion") ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = list("setosa" = 0.4, "versicolor" = 0.6) )
library(ggplot2) library(see) data <- iris[1:100, ] ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", fill = "red", color = NA ) # Different scales data[1:70, "Species"] <- "setosa" # Create unbalanced proportions ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = "auto") ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = "density") ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = "proportion") ggplot() + geom_binomdensity(data, x = "Sepal.Length", y = "Species", scale = list("setosa" = 0.4, "versicolor" = 0.6) )
These helper functions are built on top of ggplot2::layer()
and can be
used to add geom(s), whose type and content are specified as a list.
geom_from_list(x, ...) geoms_from_list(x, ...)
geom_from_list(x, ...) geoms_from_list(x, ...)
x |
A list containing:
For |
... |
Additional arguments passed to |
library(ggplot2) # Example 1 (basic geoms and labels) -------------------------- l1 <- list( geom = "point", data = mtcars, aes = list(x = "mpg", y = "wt", size = "hp", color = "hp"), show.legend = c("size" = FALSE) ) l2 <- list( geom = "labs", title = "A Title" ) ggplot() + geom_from_list(l1) + geom_from_list(l2) ggplot() + geoms_from_list(list(l1 = l1, l2 = l2)) # Example 2 (Violin, boxplots, ...) -------------------------- l1 <- list( geom = "violin", data = iris, aes = list(x = "Species", y = "Sepal.Width") ) l2 <- list( geom = "boxplot", data = iris, aes = list(x = "Species", y = "Sepal.Width"), outlier.shape = NA ) l3 <- list( geom = "jitter", data = iris, width = 0.1, aes = list(x = "Species", y = "Sepal.Width") ) ggplot() + geom_from_list(l1) + geom_from_list(l2) + geom_from_list(l3) # Example 3 (2D density) -------------------------- ggplot() + geom_from_list(list( geom = "density_2d", data = iris, aes = list(x = "Sepal.Width", y = "Petal.Length") )) ggplot() + geom_from_list(list( geom = "density_2d_filled", data = iris, aes = list(x = "Sepal.Width", y = "Petal.Length") )) ggplot() + geom_from_list(list( geom = "density_2d_polygon", data = iris, aes = list(x = "Sepal.Width", y = "Petal.Length") )) ggplot() + geom_from_list(list( geom = "density_2d_raster", data = iris, aes = list(x = "Sepal.Width", y = "Petal.Length") )) + scale_x_continuous(expand = c(0, 0)) + scale_y_continuous(expand = c(0, 0)) # Example 4 (facet and coord flip) -------------------------- ggplot(iris, aes(x = Sepal.Length, y = Petal.Width)) + geom_point() + geom_from_list(list(geom = "hline", yintercept = 2)) + geom_from_list(list(geom = "coord_flip")) + geom_from_list(list(geom = "facet_wrap", facets = "~ Species", scales = "free")) # Example 5 (theme and scales) -------------------------- ggplot(iris, aes(x = Sepal.Length, y = Petal.Width, color = Species)) + geom_point() + geom_from_list(list(geom = "scale_color_viridis_d", option = "inferno")) + geom_from_list(list(geom = "theme", legend.position = "top")) ggplot(iris, aes(x = Sepal.Length, y = Petal.Width, color = Species)) + geom_point() + geom_from_list(list(geom = "scale_color_material_d", palette = "rainbow")) + geom_from_list(list(geom = "theme_void")) # Example 5 (Smooths and side densities) -------------------------- ggplot(iris, aes(x = Sepal.Length, y = Petal.Width)) + geom_from_list(list(geom = "point")) + geom_from_list(list(geom = "smooth", color = "red")) + geom_from_list(list(aes = list(x = "Sepal.Length"), geom = "ggside::geom_xsidedensity")) + geom_from_list(list(geom = "ggside::scale_xsidey_continuous", breaks = NULL))
library(ggplot2) # Example 1 (basic geoms and labels) -------------------------- l1 <- list( geom = "point", data = mtcars, aes = list(x = "mpg", y = "wt", size = "hp", color = "hp"), show.legend = c("size" = FALSE) ) l2 <- list( geom = "labs", title = "A Title" ) ggplot() + geom_from_list(l1) + geom_from_list(l2) ggplot() + geoms_from_list(list(l1 = l1, l2 = l2)) # Example 2 (Violin, boxplots, ...) -------------------------- l1 <- list( geom = "violin", data = iris, aes = list(x = "Species", y = "Sepal.Width") ) l2 <- list( geom = "boxplot", data = iris, aes = list(x = "Species", y = "Sepal.Width"), outlier.shape = NA ) l3 <- list( geom = "jitter", data = iris, width = 0.1, aes = list(x = "Species", y = "Sepal.Width") ) ggplot() + geom_from_list(l1) + geom_from_list(l2) + geom_from_list(l3) # Example 3 (2D density) -------------------------- ggplot() + geom_from_list(list( geom = "density_2d", data = iris, aes = list(x = "Sepal.Width", y = "Petal.Length") )) ggplot() + geom_from_list(list( geom = "density_2d_filled", data = iris, aes = list(x = "Sepal.Width", y = "Petal.Length") )) ggplot() + geom_from_list(list( geom = "density_2d_polygon", data = iris, aes = list(x = "Sepal.Width", y = "Petal.Length") )) ggplot() + geom_from_list(list( geom = "density_2d_raster", data = iris, aes = list(x = "Sepal.Width", y = "Petal.Length") )) + scale_x_continuous(expand = c(0, 0)) + scale_y_continuous(expand = c(0, 0)) # Example 4 (facet and coord flip) -------------------------- ggplot(iris, aes(x = Sepal.Length, y = Petal.Width)) + geom_point() + geom_from_list(list(geom = "hline", yintercept = 2)) + geom_from_list(list(geom = "coord_flip")) + geom_from_list(list(geom = "facet_wrap", facets = "~ Species", scales = "free")) # Example 5 (theme and scales) -------------------------- ggplot(iris, aes(x = Sepal.Length, y = Petal.Width, color = Species)) + geom_point() + geom_from_list(list(geom = "scale_color_viridis_d", option = "inferno")) + geom_from_list(list(geom = "theme", legend.position = "top")) ggplot(iris, aes(x = Sepal.Length, y = Petal.Width, color = Species)) + geom_point() + geom_from_list(list(geom = "scale_color_material_d", palette = "rainbow")) + geom_from_list(list(geom = "theme_void")) # Example 5 (Smooths and side densities) -------------------------- ggplot(iris, aes(x = Sepal.Length, y = Petal.Width)) + geom_from_list(list(geom = "point")) + geom_from_list(list(geom = "smooth", color = "red")) + geom_from_list(list(aes = list(x = "Sepal.Length"), geom = "ggside::geom_xsidedensity")) + geom_from_list(list(geom = "ggside::scale_xsidey_continuous", breaks = NULL))
Somewhat nicer points (especially in case of transparency) without outline strokes (borders, contours) by default.
geom_point2(..., stroke = 0, shape = 16) geom_jitter2(..., size = 2, stroke = 0, shape = 16) geom_pointrange2(..., stroke = 0) geom_count2(..., stroke = 0) geom_count_borderless(..., stroke = 0) geom_point_borderless(...) geom_jitter_borderless(...) geom_pointrange_borderless(...)
geom_point2(..., stroke = 0, shape = 16) geom_jitter2(..., size = 2, stroke = 0, shape = 16) geom_pointrange2(..., stroke = 0) geom_count2(..., stroke = 0) geom_count_borderless(..., stroke = 0) geom_point_borderless(...) geom_jitter_borderless(...) geom_pointrange_borderless(...)
... |
Other arguments to be passed to
|
stroke |
Stroke thickness. |
shape |
Shape of points. |
size |
Size of points. |
The color aesthetics for geom_point_borderless()
is "fill"
, not
"color"
. See 'Examples'.
library(ggplot2) library(see) normal <- ggplot(iris, aes(x = Petal.Width, y = Sepal.Length)) + geom_point(size = 8, alpha = 0.3) + theme_modern() new <- ggplot(iris, aes(x = Petal.Width, y = Sepal.Length)) + geom_point2(size = 8, alpha = 0.3) + theme_modern() plots(normal, new, n_columns = 2) ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, fill = Species)) + geom_point_borderless(size = 4) + theme_modern() theme_set(theme_abyss()) ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, fill = Species)) + geom_point_borderless(size = 4)
library(ggplot2) library(see) normal <- ggplot(iris, aes(x = Petal.Width, y = Sepal.Length)) + geom_point(size = 8, alpha = 0.3) + theme_modern() new <- ggplot(iris, aes(x = Petal.Width, y = Sepal.Length)) + geom_point2(size = 8, alpha = 0.3) + theme_modern() plots(normal, new, n_columns = 2) ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, fill = Species)) + geom_point_borderless(size = 4) + theme_modern() theme_set(theme_abyss()) ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, fill = Species)) + geom_point_borderless(size = 4)
Points labelled with the observation name.
geom_poolpoint( label, size_text = 3.88, size_background = size_text * 2, size_point = size_text * 3.5, ... ) geom_pooljitter( label, size_text = 3.88, size_background = size_text * 2, size_point = size_text * 3.5, jitter = 0.1, ... )
geom_poolpoint( label, size_text = 3.88, size_background = size_text * 2, size_point = size_text * 3.5, ... ) geom_pooljitter( label, size_text = 3.88, size_background = size_text * 2, size_point = size_text * 3.5, jitter = 0.1, ... )
label |
Label to add inside the points. |
size_text |
Size of text. |
size_background |
Size of the white background circle. |
size_point |
Size of the ball. |
... |
Other arguments to be passed to |
jitter |
Width and height of position jitter. |
library(ggplot2) library(see) ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, color = Species)) + geom_poolpoint(label = rownames(iris)) + scale_color_flat_d() + theme_modern() ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, color = Species)) + geom_pooljitter(label = rownames(iris)) + scale_color_flat_d() + theme_modern()
library(ggplot2) library(see) ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, color = Species)) + geom_poolpoint(label = rownames(iris)) + scale_color_flat_d() + theme_modern() ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, color = Species)) + geom_pooljitter(label = rownames(iris)) + scale_color_flat_d() + theme_modern()
Create a half-violin half-dot plot, useful for visualising the distribution and the sample size at the same time.
geom_violindot( mapping = NULL, data = NULL, trim = TRUE, scale = c("area", "count", "width"), show.legend = NA, inherit.aes = TRUE, dots_size = 0.7, dots_color = NULL, dots_fill = NULL, binwidth = 0.05, position_dots = ggplot2::position_nudge(x = -0.025, y = 0), ..., size_dots = dots_size, color_dots = dots_color, fill_dots = dots_fill )
geom_violindot( mapping = NULL, data = NULL, trim = TRUE, scale = c("area", "count", "width"), show.legend = NA, inherit.aes = TRUE, dots_size = 0.7, dots_color = NULL, dots_fill = NULL, binwidth = 0.05, position_dots = ggplot2::position_nudge(x = -0.025, y = 0), ..., size_dots = dots_size, color_dots = dots_color, fill_dots = dots_fill )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
trim |
If |
scale |
if "area" (default), all violins have the same area (before trimming the tails). If "count", areas are scaled proportionally to the number of observations. If "width", all violins have the same maximum width. |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
binwidth |
When |
position_dots |
Position adjustment for dots, either as a string, or the result of a call to a position adjustment function. |
... |
Other arguments passed on to
|
size_dots , dots_size
|
Size adjustment for dots. |
color_dots , dots_color
|
Color adjustment for dots. |
fill_dots , dots_fill
|
Fill adjustment for dots. |
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violindot() + theme_modern()
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violindot() + theme_modern()
Create a half-violin plot.
geom_violinhalf( mapping = NULL, data = NULL, stat = "ydensity", position = "dodge", trim = TRUE, flip = FALSE, scale = c("area", "count", "width"), show.legend = NA, inherit.aes = TRUE, ... )
geom_violinhalf( mapping = NULL, data = NULL, stat = "ydensity", position = "dodge", trim = TRUE, flip = FALSE, scale = c("area", "count", "width"), show.legend = NA, inherit.aes = TRUE, ... )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
trim |
If |
flip |
Should the half-violin plot switch directions? By default, this
is |
scale |
if "area" (default), all violins have the same area (before trimming the tails). If "count", areas are scaled proportionally to the number of observations. If "width", all violins have the same maximum width. |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
Other arguments passed on to
|
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violinhalf() + theme_modern() + scale_fill_material_d() # To flip all half-violin geoms, use `flip = TRUE`: ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violinhalf(flip = TRUE) + theme_modern() + scale_fill_material_d() # To flip the half-violin geoms for the first and third groups only # by passing a numeric vector ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violinhalf(flip = c(1, 3)) + theme_modern() + scale_fill_material_d()
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violinhalf() + theme_modern() + scale_fill_material_d() # To flip all half-violin geoms, use `flip = TRUE`: ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violinhalf(flip = TRUE) + theme_modern() + scale_fill_material_d() # To flip the half-violin geoms for the first and third groups only # by passing a numeric vector ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violinhalf(flip = c(1, 3)) + theme_modern() + scale_fill_material_d()
Returns the golden ratio (1.618034...). Useful to easily obtain golden
proportions, for instance for a horizontal figure, if you want its height to
be 8, you can set its width to be golden_ratio(8)
.
golden_ratio(x = 1)
golden_ratio(x = 1)
x |
A number to be multiplied by the golden ratio. The default ( |
golden_ratio() golden_ratio(10)
golden_ratio() golden_ratio(10)
Can be used to get the hex code of specific colors from the material design
color palette. Use material_colors()
to see all available colors.
material_colors(...)
material_colors(...)
... |
Character names of colors. |
A character vector with color-codes.
material_colors() material_colors("indigo", "lime")
material_colors() material_colors("indigo", "lime")
Can be used to get the hex code of specific colors from the Metro color
palette. Use metro_colors()
to see all available colors.
metro_colors(...)
metro_colors(...)
... |
Character names of colors. |
A character vector with color-codes.
metro_colors() metro_colors("dark red", "teal")
metro_colors() metro_colors("dark red", "teal")
Can be used to get the hex code of specific colors from the Okabe-Ito palette.
Use okabeito_colors()
to see all available colors.
okabeito_colors(..., original_names = FALSE, black_first = FALSE, amber = TRUE) oi_colors(..., original_names = FALSE, black_first = FALSE, amber = TRUE)
okabeito_colors(..., original_names = FALSE, black_first = FALSE, amber = TRUE) oi_colors(..., original_names = FALSE, black_first = FALSE, amber = TRUE)
... |
Character names of colors. |
original_names |
Logical. Should the colors be named using the original
names used by Okabe and Ito (2008), such as "vermillion" ( |
black_first |
Logical. Should black be first ( |
amber |
If amber color should replace yellow in the palette. |
A character vector with color-codes.
okabeito_colors() okabeito_colors(c("red", "light blue", "orange")) okabeito_colors(original_names = TRUE) okabeito_colors(black_first = TRUE)
okabeito_colors() okabeito_colors(c("red", "light blue", "orange")) okabeito_colors(original_names = TRUE) okabeito_colors(black_first = TRUE)
The palette based on blue-brown colors.
palette_bluebrown(palette = "contrast", reverse = FALSE, ...)
palette_bluebrown(palette = "contrast", reverse = FALSE, ...)
palette |
Character name of palette. Depending on the color scale, can
be |
reverse |
Boolean indicating whether the palette should be reversed. |
... |
Additional arguments to pass to |
This function is usually not called directly, but from within
scale_color_bluebrown()
.
This function downloads a requested color palette from https://www.color-hex.com/. This website provides a large number of user-submitted color palettes.
palette_colorhex(palette = 1014416, reverse = FALSE, ...)
palette_colorhex(palette = 1014416, reverse = FALSE, ...)
palette |
The numeric code for a palette at https://www.color-hex.com/.
For example, |
reverse |
Boolean indicating whether the palette should be reversed. |
... |
Additional arguments to pass to |
This function is usually not called directly, but from within
scale_color_colorhex()
.
The default Josiah color palette (number 1014416) is available without an internet connection. All other color palettes require an internet connection to download and access.
The palette based on Flat UI.
palette_flat(palette = "contrast", reverse = FALSE, ...)
palette_flat(palette = "contrast", reverse = FALSE, ...)
palette |
Character name of palette. Depending on the color scale, can
be |
reverse |
Boolean indicating whether the palette should be reversed. |
... |
Additional arguments to pass to |
This function is usually not called directly, but from within
scale_color_flat()
.
The palette based on material design colors.
palette_material(palette = "contrast", reverse = FALSE, ...)
palette_material(palette = "contrast", reverse = FALSE, ...)
palette |
Character name of palette. Depending on the color scale, can
be |
reverse |
Boolean indicating whether the palette should be reversed. |
... |
Additional arguments to pass to |
This function is usually not called directly, but from within
scale_color_material()
.
The palette based on Metro colors.
palette_metro(palette = "complement", reverse = FALSE, ...)
palette_metro(palette = "complement", reverse = FALSE, ...)
palette |
Character name of palette. Depending on the color scale, can
be |
reverse |
Boolean indicating whether the palette should be reversed. |
... |
Additional arguments to pass to |
This function is usually not called directly, but from within
scale_color_metro()
.
The palette based proposed by Okabe and Ito (2008).
palette_okabeito(palette = "full_amber", reverse = FALSE, order = 1:9, ...) palette_oi(palette = "full_amber", reverse = FALSE, order = 1:9, ...)
palette_okabeito(palette = "full_amber", reverse = FALSE, order = 1:9, ...) palette_oi(palette = "full_amber", reverse = FALSE, order = 1:9, ...)
palette |
Character name of palette. Depending on the color scale, can
be |
reverse |
Boolean indicating whether the palette should be reversed. |
order |
A vector of numbers from 1 to 9 indicating the order of colors to use
(default: |
... |
Additional arguments to pass to |
This function is usually not called directly, but from within
scale_color_material()
.
Okabe, M., & Ito, K. (2008). Color universal design (CUD): How to make figures and presentations that are friendly to colorblind people. https://jfly.uni-koeln.de/color/#pallet (Original work published 2002)
The palette based on authentic neapolitan pizzas.
palette_pizza(palette = "margherita", reverse = FALSE, ...)
palette_pizza(palette = "margherita", reverse = FALSE, ...)
palette |
Pizza type. Can be "margherita" (default), "margherita_crust", "diavola" or "diavola_crust". |
reverse |
Boolean indicating whether the palette should be reversed. |
... |
Additional arguments to pass to |
This function is usually not called directly, but from within
scale_color_pizza()
.
See design color palette
palette_see(palette = "contrast", reverse = FALSE, ...)
palette_see(palette = "contrast", reverse = FALSE, ...)
palette |
Character name of palette. Depending on the color scale, can
be |
reverse |
Boolean indicating whether the palette should be reversed. |
... |
Additional arguments to pass to |
This function is usually not called directly, but from within
scale_color_see()
.
The palette based Social colors.
palette_social(palette = "complement", reverse = FALSE, ...)
palette_social(palette = "complement", reverse = FALSE, ...)
palette |
Character name of palette. Depending on the color scale, can
be |
reverse |
Boolean indicating whether the palette should be reversed. |
... |
Additional arguments to pass to |
This function is usually not called directly, but from within
scale_color_social()
.
Extract pizza colors as hex codes
pizza_colors(...)
pizza_colors(...)
... |
Character names of pizza ingredients. |
A character vector with color-codes.
Plot tabulated data.
## S3 method for class 'datawizard_tables' plot( x, label_values = TRUE, show_na = c("if_any", "always", "never"), na_label = "(Missing)", error_bar = TRUE, ci = 0.95, fill_col = "#87CEFA", color_error_bar = "#607B8B", ... ) ## S3 method for class 'datawizard_table' plot( x, label_values = TRUE, show_na = c("if_any", "always", "never"), na_label = "(Missing)", error_bar = TRUE, ci = 0.95, fill_col = "#87CEFA", color_error_bar = "#607B8B", ... )
## S3 method for class 'datawizard_tables' plot( x, label_values = TRUE, show_na = c("if_any", "always", "never"), na_label = "(Missing)", error_bar = TRUE, ci = 0.95, fill_col = "#87CEFA", color_error_bar = "#607B8B", ... ) ## S3 method for class 'datawizard_table' plot( x, label_values = TRUE, show_na = c("if_any", "always", "never"), na_label = "(Missing)", error_bar = TRUE, ci = 0.95, fill_col = "#87CEFA", color_error_bar = "#607B8B", ... )
x |
Object created by |
label_values |
Logical. Should values and percentages be displayed at the top of each bar. |
show_na |
Should missing values be dropped? Can be |
na_label |
The label given to missing values when they are shown. |
error_bar |
Logical. Should error bars be displayed?
If |
ci |
Confidence Interval (CI) level. Defaults to |
fill_col |
Color to use for category columns (default: |
color_error_bar |
Color to use for error bars (default: |
... |
Unused |
Brown, L. D., Cai, T. T., & Dasgupta, A. (2001). Interval estimation for a binomial proportion. Statistical Science, 16(2), 101-133. doi:10.1214/ss/1009213286
The plot()
method for the bayestestR::bayesfactor_models()
function.
These plots visualize the posterior probabilities of the compared models.
## S3 method for class 'see_bayesfactor_models' plot( x, n_pies = c("one", "many"), value = c("none", "BF", "probability"), sort = FALSE, log = FALSE, prior_odds = NULL, ... )
## S3 method for class 'see_bayesfactor_models' plot( x, n_pies = c("one", "many"), value = c("none", "BF", "probability"), sort = FALSE, log = FALSE, prior_odds = NULL, ... )
x |
An object. |
n_pies |
Number of pies. |
value |
What value to display. |
sort |
The behavior of this argument depends on the plotting contexts.
|
log |
Logical that decides whether to display log-transformed Bayes factors. |
prior_odds |
An optional vector of prior odds for the models. See
|
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(bayestestR) library(see) lm0 <- lm(qsec ~ 1, data = mtcars) lm1 <- lm(qsec ~ drat, data = mtcars) lm2 <- lm(qsec ~ wt, data = mtcars) lm3 <- lm(qsec ~ drat + wt, data = mtcars) result <- bayesfactor_models(lm1, lm2, lm3, denominator = lm0) plot(result, n_pies = "one", value = "probability", sort = TRUE) + scale_fill_pizza(reverse = TRUE) plot(result, n_pies = "many", value = "BF", log = TRUE) + scale_fill_pizza(reverse = FALSE)
library(bayestestR) library(see) lm0 <- lm(qsec ~ 1, data = mtcars) lm1 <- lm(qsec ~ drat, data = mtcars) lm2 <- lm(qsec ~ wt, data = mtcars) lm3 <- lm(qsec ~ drat + wt, data = mtcars) result <- bayesfactor_models(lm1, lm2, lm3, denominator = lm0) plot(result, n_pies = "one", value = "probability", sort = TRUE) + scale_fill_pizza(reverse = TRUE) plot(result, n_pies = "many", value = "BF", log = TRUE) + scale_fill_pizza(reverse = FALSE)
The plot()
method for the bayestestR::bayesfactor_parameters()
function.
## S3 method for class 'see_bayesfactor_parameters' plot( x, size_point = 2, rope_color = "#0171D3", rope_alpha = 0.2, show_intercept = FALSE, ... )
## S3 method for class 'see_bayesfactor_parameters' plot( x, size_point = 2, rope_color = "#0171D3", rope_alpha = 0.2, show_intercept = FALSE, ... )
x |
An object. |
size_point |
Numeric specifying size of point-geoms. |
rope_color |
Character specifying color of ROPE ribbon. |
rope_alpha |
Numeric specifying transparency level of ROPE ribbon. |
show_intercept |
Logical, if |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
The plot()
method for the performance::check_collinearity()
function.
## S3 method for class 'see_check_collinearity' plot( x, data = NULL, colors = c("#3aaf85", "#1b6ca8", "#cd201f"), size_point = 3.5, size_line = 0.8, size_title = 12, size_axis_title = base_size, base_size = 10, ... )
## S3 method for class 'see_check_collinearity' plot( x, data = NULL, colors = c("#3aaf85", "#1b6ca8", "#cd201f"), size_point = 3.5, size_line = 0.8, size_title = 12, size_axis_title = base_size, base_size = 10, ... )
x |
An object. |
data |
The original data used to create this object. Can be a statistical model. |
colors |
Character vector of length two, indicating the colors (in hex-format) for points and line. |
size_point |
Numeric specifying size of point-geoms. |
size_line |
Numeric value specifying size of line geoms. |
base_size , size_axis_title , size_title
|
Numeric value specifying size of axis and plot titles. |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(performance) m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) result <- check_collinearity(m) result plot(result)
library(performance) m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) result <- check_collinearity(m) result plot(result)
The plot()
method for the performance::check_dag()
function.
## S3 method for class 'see_check_dag' plot( x, size_point = 20, size_text = 4.5, colors = NULL, which = "all", effect = "total", check_colliders = TRUE, ... )
## S3 method for class 'see_check_dag' plot( x, size_point = 20, size_text = 4.5, colors = NULL, which = "all", effect = "total", check_colliders = TRUE, ... )
x |
A |
size_point |
Numeric value specifying size of point geoms. |
size_text |
Numeric value specifying size of text elements. |
colors |
Character vector of length five, indicating the colors (in
hex-format) for different types of variables, which are assigned in following
order: |
which |
Character string indicating which plot to show. Can be either
|
effect |
Character string indicating which effect for the required model
is to be estimated. Can be either |
check_colliders |
Logical indicating whether to highlight colliders.
Set to |
... |
Currently not used. |
A ggplot2-object.
library(performance) # incorrect adjustment dag <- check_dag( y ~ x + b + c, x ~ b, outcome = "y", exposure = "x" ) dag plot(dag) # plot only model with required adjustments plot(dag, which = "required") # collider-bias? dag <- check_dag( y ~ x + c + d, x ~ c + d, b ~ x, b ~ y, outcome = "y", exposure = "x", adjusted = "c" ) plot(dag) # longer labels, automatic detection of outcome and exposure dag <- check_dag( QoL ~ age + education + gender, age ~ education ) plot(dag)
library(performance) # incorrect adjustment dag <- check_dag( y ~ x + b + c, x ~ b, outcome = "y", exposure = "x" ) dag plot(dag) # plot only model with required adjustments plot(dag, which = "required") # collider-bias? dag <- check_dag( y ~ x + c + d, x ~ c + d, b ~ x, b ~ y, outcome = "y", exposure = "x", adjusted = "c" ) plot(dag) # longer labels, automatic detection of outcome and exposure dag <- check_dag( QoL ~ age + education + gender, age ~ education ) plot(dag)
The plot()
method for the performance::check_distribution()
function.
## S3 method for class 'see_check_distribution' plot(x, size_point = 2, panel = TRUE, ...)
## S3 method for class 'see_check_distribution' plot(x, size_point = 2, panel = TRUE, ...)
x |
An object. |
size_point |
Numeric specifying size of point-geoms. |
panel |
Logical, if |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(performance) m <<- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) result <- check_distribution(m) result plot(result)
library(performance) m <<- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) result <- check_distribution(m) result plot(result)
The plot()
method for the
performance::check_heteroscedasticity()
function.
## S3 method for class 'see_check_heteroscedasticity' plot( x, data = NULL, size_point = 2, size_line = 0.8, size_title = 12, size_axis_title = base_size, base_size = 10, ... )
## S3 method for class 'see_check_heteroscedasticity' plot( x, data = NULL, size_point = 2, size_line = 0.8, size_title = 12, size_axis_title = base_size, base_size = 10, ... )
x |
An object. |
data |
The original data used to create this object. Can be a statistical model. |
size_point |
Numeric specifying size of point-geoms. |
size_line |
Numeric value specifying size of line geoms. |
base_size , size_axis_title , size_title
|
Numeric value specifying size of axis and plot titles. |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
See also the vignette about check_model()
.
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) result <- performance::check_heteroscedasticity(m) result plot(result, data = m) # data required for pkgdown
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) result <- performance::check_heteroscedasticity(m) result plot(result, data = m) # data required for pkgdown
The plot()
method for the performance::check_homogeneity()
function.
## S3 method for class 'see_check_homogeneity' plot(x, data = NULL, ...)
## S3 method for class 'see_check_homogeneity' plot(x, data = NULL, ...)
x |
An object. |
data |
The original data used to create this object. Can be a statistical model. |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(performance) model <<- lm(len ~ supp + dose, data = ToothGrowth) result <- check_homogeneity(model) result plot(result)
library(performance) model <<- lm(len ~ supp + dose, data = ToothGrowth) result <- check_homogeneity(model) result plot(result)
The plot()
method for the performance::check_model()
function.
Diagnostic plots for regression models.
## S3 method for class 'see_check_model' plot( x, style = theme_lucid, colors = NULL, type = c("density", "discrete_dots", "discrete_interval", "discrete_both"), n_columns = 2, ... )
## S3 method for class 'see_check_model' plot( x, style = theme_lucid, colors = NULL, type = c("density", "discrete_dots", "discrete_interval", "discrete_both"), n_columns = 2, ... )
x |
An object. |
style |
A ggplot2-theme. |
colors |
Character vector of length two, indicating the colors (in hex-format) for points and line. |
type |
Plot type for the posterior predictive checks plot. Can be |
n_columns |
Number of columns to align plots. |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
See also the vignette about check_model()
.
library(performance) model <- lm(qsec ~ drat + wt, data = mtcars) plot(check_model(model))
library(performance) model <- lm(qsec ~ drat + wt, data = mtcars) plot(check_model(model))
The plot()
method for the performance::check_normality()
function.
## S3 method for class 'see_check_normality' plot( x, type = c("qq", "pp", "density"), data = NULL, size_line = 0.8, size_point = 2, size_title = 12, size_axis_title = base_size, base_size = 10, alpha = 0.2, dot_alpha = 0.8, colors = c("#3aaf85", "#1b6ca8"), detrend = TRUE, method = "ell", ... )
## S3 method for class 'see_check_normality' plot( x, type = c("qq", "pp", "density"), data = NULL, size_line = 0.8, size_point = 2, size_title = 12, size_axis_title = base_size, base_size = 10, alpha = 0.2, dot_alpha = 0.8, colors = c("#3aaf85", "#1b6ca8"), detrend = TRUE, method = "ell", ... )
x |
An object. |
type |
Character vector, indicating the type of plot.
Options are |
data |
The original data used to create this object. Can be a statistical model. |
size_line |
Numeric value specifying size of line geoms. |
size_point |
Numeric specifying size of point-geoms. |
base_size , size_axis_title , size_title
|
Numeric value specifying size of axis and plot titles. |
alpha |
Numeric value specifying alpha level of the confidence bands. |
dot_alpha |
Numeric value specifying alpha level of the point geoms. |
colors |
Character vector of length two, indicating the colors (in hex-format) for points and line. |
detrend |
Logical that decides if Q-Q and P-P plots should be de-trended (also known as worm plots). |
method |
The method used for estimating the qq/pp bands. Default to
|
... |
Arguments passed to or from other methods. |
A ggplot2-object.
See also the vignette about check_model()
.
library(performance) m <<- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) result <- check_normality(m) plot(result) plot(result, type = "qq", detrend = TRUE)
library(performance) m <<- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) result <- check_normality(m) plot(result) plot(result, type = "qq", detrend = TRUE)
The plot()
method for the performance::check_outliers()
function.
## S3 method for class 'see_check_outliers' plot( x, size_text = 3.5, size_line = 0.8, size_title = 12, size_axis_title = base_size, base_size = 10, dot_alpha = 0.8, colors = c("#3aaf85", "#1b6ca8", "#cd201f"), rescale_distance = TRUE, type = c("dots", "bars"), show_labels = TRUE, ... )
## S3 method for class 'see_check_outliers' plot( x, size_text = 3.5, size_line = 0.8, size_title = 12, size_axis_title = base_size, base_size = 10, dot_alpha = 0.8, colors = c("#3aaf85", "#1b6ca8", "#cd201f"), rescale_distance = TRUE, type = c("dots", "bars"), show_labels = TRUE, ... )
x |
An object. |
size_text |
Numeric value specifying size of text labels. |
size_line |
Numeric value specifying size of line geoms. |
base_size , size_axis_title , size_title
|
Numeric value specifying size of axis and plot titles. |
dot_alpha |
Numeric value specifying alpha level of the point geoms. |
colors |
Character vector of length two, indicating the colors (in hex-format) for points and line. |
rescale_distance |
Logical. If |
type |
Character vector, indicating the type of plot.
Options are |
show_labels |
Logical. If |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(performance) data(mtcars) mt1 <- mtcars[, c(1, 3, 4)] mt2 <- rbind( mt1, data.frame(mpg = c(37, 40), disp = c(300, 400), hp = c(110, 120)) ) model <- lm(disp ~ mpg + hp, data = mt2) plot(check_outliers(model))
library(performance) data(mtcars) mt1 <- mtcars[, c(1, 3, 4)] mt2 <- rbind( mt1, data.frame(mpg = c(37, 40), disp = c(300, 400), hp = c(110, 120)) ) model <- lm(disp ~ mpg + hp, data = mt2) plot(check_outliers(model))
The plot()
method for the parameters::compare_parameters()
function.
## S3 method for class 'see_compare_parameters' plot( x, show_intercept = FALSE, size_point = 0.8, size_text = NA, dodge_position = 0.8, sort = NULL, n_columns = NULL, show_labels = FALSE, ... )
## S3 method for class 'see_compare_parameters' plot( x, show_intercept = FALSE, size_point = 0.8, size_text = NA, dodge_position = 0.8, sort = NULL, n_columns = NULL, show_labels = FALSE, ... )
x |
An object. |
show_intercept |
Logical, if |
size_point |
Numeric specifying size of point-geoms. |
size_text |
Numeric value specifying size of text labels. |
dodge_position |
Numeric value specifying the amount of "dodging" (spacing) between geoms. |
sort |
The behavior of this argument depends on the plotting contexts.
|
n_columns |
For models with multiple components (like fixed and random,
count and zero-inflated), defines the number of columns for the
panel-layout. If |
show_labels |
Logical. If |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
data(iris) lm1 <- lm(Sepal.Length ~ Species, data = iris) lm2 <- lm(Sepal.Length ~ Species + Petal.Length, data = iris) lm3 <- lm(Sepal.Length ~ Species * Petal.Length, data = iris) result <- parameters::compare_parameters(lm1, lm2, lm3) plot(result)
data(iris) lm1 <- lm(Sepal.Length ~ Species, data = iris) lm2 <- lm(Sepal.Length ~ Species + Petal.Length, data = iris) lm3 <- lm(Sepal.Length ~ Species * Petal.Length, data = iris) result <- parameters::compare_parameters(lm1, lm2, lm3) plot(result)
The plot()
method for the performance::compare_performance()
function.
## S3 method for class 'see_compare_performance' plot(x, size_line = 1, ...)
## S3 method for class 'see_compare_performance' plot(x, size_line = 1, ...)
x |
An object. |
size_line |
Numeric value specifying size of line geoms. |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(performance) data(iris) lm1 <- lm(Sepal.Length ~ Species, data = iris) lm2 <- lm(Sepal.Length ~ Species + Petal.Length, data = iris) lm3 <- lm(Sepal.Length ~ Species * Petal.Length, data = iris) result <- compare_performance(lm1, lm2, lm3) result plot(result)
library(performance) data(iris) lm1 <- lm(Sepal.Length ~ Species, data = iris) lm2 <- lm(Sepal.Length ~ Species + Petal.Length, data = iris) lm3 <- lm(Sepal.Length ~ Species * Petal.Length, data = iris) result <- compare_performance(lm1, lm2, lm3) result plot(result)
The plot()
method for the effectsize::effectsize()
function.
## S3 method for class 'see_effectsize_table' plot(x, ...)
## S3 method for class 'see_effectsize_table' plot(x, ...)
x |
An object. |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(effectsize) m <- aov(mpg ~ factor(am) * factor(cyl), data = mtcars) result <- eta_squared(m) plot(result)
library(effectsize) m <- aov(mpg ~ factor(am) * factor(cyl), data = mtcars) result <- eta_squared(m) plot(result)
The plot()
method for the bayestestR::equivalence_test()
function.
## S3 method for class 'see_equivalence_test_effectsize' plot(x, ...) ## S3 method for class 'see_equivalence_test' plot( x, rope_color = "#0171D3", rope_alpha = 0.2, show_intercept = FALSE, n_columns = 1, ... ) ## S3 method for class 'see_equivalence_test_lm' plot( x, size_point = 0.7, rope_color = "#0171D3", rope_alpha = 0.2, show_intercept = FALSE, n_columns = 1, ... )
## S3 method for class 'see_equivalence_test_effectsize' plot(x, ...) ## S3 method for class 'see_equivalence_test' plot( x, rope_color = "#0171D3", rope_alpha = 0.2, show_intercept = FALSE, n_columns = 1, ... ) ## S3 method for class 'see_equivalence_test_lm' plot( x, size_point = 0.7, rope_color = "#0171D3", rope_alpha = 0.2, show_intercept = FALSE, n_columns = 1, ... )
x |
An object. |
... |
Arguments passed to or from other methods. |
rope_color |
Character specifying color of ROPE ribbon. |
rope_alpha |
Numeric specifying transparency level of ROPE ribbon. |
show_intercept |
Logical, if |
n_columns |
For models with multiple components (like fixed and random,
count and zero-inflated), defines the number of columns for the
panel-layout. If |
size_point |
Numeric specifying size of point-geoms. |
A ggplot2-object.
library(effectsize) m <- aov(mpg ~ factor(am) * factor(cyl), data = mtcars) result <- eta_squared(m) plot(result)
library(effectsize) m <- aov(mpg ~ factor(am) * factor(cyl), data = mtcars) result <- eta_squared(m) plot(result)
The plot()
method for the modelbased::estimate_contrasts()
function.
## S3 method for class 'see_estimate_contrasts' plot(x, data = NULL, ...)
## S3 method for class 'see_estimate_contrasts' plot(x, data = NULL, ...)
x |
An object. |
data |
The original data used to create this object. Can be a statistical model. |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(modelbased) model <- lm(Sepal.Width ~ Species, data = iris) contrasts <- estimate_contrasts(model) means <- estimate_means(model) plot(contrasts, means)
library(modelbased) model <- lm(Sepal.Width ~ Species, data = iris) contrasts <- estimate_contrasts(model) means <- estimate_means(model) plot(contrasts, means)
The plot()
method for the bayestestR::estimate_density()
function.
## S3 method for class 'see_estimate_density' plot( x, stack = TRUE, show_intercept = FALSE, n_columns = 1, priors = FALSE, priors_alpha = 0.4, posteriors_alpha = 0.7, size_line = 0.9, size_point = 2, centrality = "median", ci = 0.95, ... )
## S3 method for class 'see_estimate_density' plot( x, stack = TRUE, show_intercept = FALSE, n_columns = 1, priors = FALSE, priors_alpha = 0.4, posteriors_alpha = 0.7, size_line = 0.9, size_point = 2, centrality = "median", ci = 0.95, ... )
x |
An object. |
stack |
Logical. If |
show_intercept |
Logical, if |
n_columns |
For models with multiple components (like fixed and random,
count and zero-inflated), defines the number of columns for the
panel-layout. If |
priors |
Logical. If |
priors_alpha |
Numeric value specifying alpha for the prior distributions. |
posteriors_alpha |
Numeric value specifying alpha for the posterior distributions. |
size_line |
Numeric value specifying size of line geoms. |
size_point |
Numeric specifying size of point-geoms. |
centrality |
Character specifying the point-estimate (centrality index)
to compute. Can be |
ci |
Numeric value of probability of the CI (between 0 and 1) to be
estimated. Default to |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(rstanarm) library(bayestestR) set.seed(123) m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- estimate_density(m) plot(result)
library(rstanarm) library(bayestestR) set.seed(123) m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- estimate_density(m) plot(result)
The plot()
method for the bayestestR::hdi()
and related
function.
## S3 method for class 'see_hdi' plot( x, data = NULL, show_intercept = FALSE, show_zero = TRUE, show_title = TRUE, n_columns = 1, ... )
## S3 method for class 'see_hdi' plot( x, data = NULL, show_intercept = FALSE, show_zero = TRUE, show_title = TRUE, n_columns = 1, ... )
x |
An object. |
data |
The original data used to create this object. Can be a statistical model. |
show_intercept |
Logical, if |
show_zero |
Logical. If |
show_title |
Logical. If |
n_columns |
For models with multiple components (like fixed and random,
count and zero-inflated), defines the number of columns for the
panel-layout. If |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(rstanarm) library(bayestestR) set.seed(123) m <- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- bayestestR::hdi(m) result plot(result)
library(rstanarm) library(bayestestR) set.seed(123) m <- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- bayestestR::hdi(m) result plot(result)
The plot()
method for the parameters::n_factors()
and parameters::n_clusters()
## S3 method for class 'see_n_factors' plot(x, data = NULL, type = c("bar", "line", "area"), size = 1, ...)
## S3 method for class 'see_n_factors' plot(x, data = NULL, type = c("bar", "line", "area"), size = 1, ...)
x |
An object. |
data |
The original data used to create this object. Can be a statistical model. |
type |
Character vector, indicating the type of plot.
Options are three different shapes to illustrate the degree of consensus
between dimensionality methods for each number of factors;
|
size |
Depending on |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
data(mtcars) result <- parameters::n_factors(mtcars, type = "PCA") result plot(result) # type = "bar" by default plot(result, type = "line") plot(result, type = "area")
data(mtcars) result <- parameters::n_factors(mtcars, type = "PCA") result plot(result) # type = "bar" by default plot(result, type = "line") plot(result, type = "area")
The plot()
method for the bayestestR::p_direction()
function.
## S3 method for class 'see_p_direction' plot( x, data = NULL, show_intercept = FALSE, priors = FALSE, priors_alpha = 0.4, n_columns = 1, ... )
## S3 method for class 'see_p_direction' plot( x, data = NULL, show_intercept = FALSE, priors = FALSE, priors_alpha = 0.4, n_columns = 1, ... )
x |
An object. |
data |
The original data used to create this object. Can be a statistical model. |
show_intercept |
Logical, if |
priors |
Logical. If |
priors_alpha |
Numeric value specifying alpha for the prior distributions. |
n_columns |
For models with multiple components (like fixed and random,
count and zero-inflated), defines the number of columns for the
panel-layout. If |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(rstanarm) library(bayestestR) set.seed(123) m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- p_direction(m) plot(result)
library(rstanarm) library(bayestestR) set.seed(123) m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- p_direction(m) plot(result)
The plot()
method for the parameters::p_function ()
.
## S3 method for class 'see_p_function' plot( x, colors = c("black", "#1b6ca8"), size_point = 1.2, size_line = c(0.7, 0.9), size_text = 3, line_alpha = 0.15, show_labels = TRUE, n_columns = NULL, show_intercept = FALSE, ... )
## S3 method for class 'see_p_function' plot( x, colors = c("black", "#1b6ca8"), size_point = 1.2, size_line = c(0.7, 0.9), size_text = 3, line_alpha = 0.15, show_labels = TRUE, n_columns = NULL, show_intercept = FALSE, ... )
x |
An object returned by |
colors |
Character vector of length two, indicating the colors (in hex-format) used when only one parameter is plotted, resp. when panels are plotted as facets. |
size_point |
Numeric specifying size of point-geoms. |
size_line |
Numeric value specifying size of line geoms. |
size_text |
Numeric value specifying size of text labels. |
line_alpha |
Numeric value specifying alpha of lines indicating the
emphasized compatibility interval levels (see |
show_labels |
Logical. If |
n_columns |
For models with multiple components (like fixed and random,
count and zero-inflated), defines the number of columns for the
panel-layout. If |
show_intercept |
Logical, if |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(parameters) model <- lm(Sepal.Length ~ Species + Sepal.Width + Petal.Length, data = iris) result <- p_function(model) plot(result, n_columns = 2, show_labels = FALSE) result <- p_function(model, keep = "Sepal.Width") plot(result)
library(parameters) model <- lm(Sepal.Length ~ Species + Sepal.Width + Petal.Length, data = iris) result <- p_function(model) plot(result, n_columns = 2, show_labels = FALSE) result <- p_function(model, keep = "Sepal.Width") plot(result)
The plot()
method for the bayestestR::p_significance()
function.
## S3 method for class 'see_p_significance' plot( x, data = NULL, show_intercept = FALSE, priors = FALSE, priors_alpha = 0.4, n_columns = 1, ... )
## S3 method for class 'see_p_significance' plot( x, data = NULL, show_intercept = FALSE, priors = FALSE, priors_alpha = 0.4, n_columns = 1, ... )
x |
An object. |
data |
The original data used to create this object. Can be a statistical model. |
show_intercept |
Logical, if |
priors |
Logical. If |
priors_alpha |
Numeric value specifying alpha for the prior distributions. |
n_columns |
For models with multiple components (like fixed and random,
count and zero-inflated), defines the number of columns for the
panel-layout. If |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(rstanarm) library(bayestestR) set.seed(123) m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- p_significance(m) plot(result)
library(rstanarm) library(bayestestR) set.seed(123) m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- p_significance(m) plot(result)
The plot()
method for the parameters::model_parameters()
function when used with brms-meta-analysis models.
## S3 method for class 'see_parameters_brms_meta' plot( x, size_point = 2, size_line = 0.8, size_text = 3.5, posteriors_alpha = 0.7, rope_alpha = 0.15, rope_color = "cadetblue", normalize_height = TRUE, show_labels = TRUE, ... )
## S3 method for class 'see_parameters_brms_meta' plot( x, size_point = 2, size_line = 0.8, size_text = 3.5, posteriors_alpha = 0.7, rope_alpha = 0.15, rope_color = "cadetblue", normalize_height = TRUE, show_labels = TRUE, ... )
x |
An object. |
size_point |
Numeric specifying size of point-geoms. |
size_line |
Numeric value specifying size of line geoms. |
size_text |
Numeric value specifying size of text labels. |
posteriors_alpha |
Numeric value specifying alpha for the posterior distributions. |
rope_alpha |
Numeric specifying transparency level of ROPE ribbon. |
rope_color |
Character specifying color of ROPE ribbon. |
normalize_height |
Logical. If |
show_labels |
Logical. If |
... |
Arguments passed to or from other methods. |
To change the colors of the density areas, use scale_fill_manual()
with named color-values, e.g. scale_fill_manual(values = c("Study" = "blue", "Overall" = "green"))
.
To change the color of the error bars, use scale_color_manual(values = c("Errorbar" = "red"))
.
Use show_labels = FALSE
to hide the textual
output of estimates and credible intervals.
A ggplot2-object.
library(parameters) library(brms) library(metafor) data(dat.bcg) dat <- escalc( measure = "RR", ai = tpos, bi = tneg, ci = cpos, di = cneg, data = dat.bcg ) dat$author <- make.unique(dat$author) # model set.seed(123) priors <- c( prior(normal(0, 1), class = Intercept), prior(cauchy(0, 0.5), class = sd) ) model <- suppressWarnings( brm(yi | se(vi) ~ 1 + (1 | author), data = dat, refresh = 0, silent = 2) ) # result mp <- model_parameters(model) plot(mp)
library(parameters) library(brms) library(metafor) data(dat.bcg) dat <- escalc( measure = "RR", ai = tpos, bi = tneg, ci = cpos, di = cneg, data = dat.bcg ) dat$author <- make.unique(dat$author) # model set.seed(123) priors <- c( prior(normal(0, 1), class = Intercept), prior(cauchy(0, 0.5), class = sd) ) model <- suppressWarnings( brm(yi | se(vi) ~ 1 + (1 | author), data = dat, refresh = 0, silent = 2) ) # result mp <- model_parameters(model) plot(mp)
The plot()
method for the parameters::describe_distribution()
function.
## S3 method for class 'see_parameters_distribution' plot( x, dispersion = FALSE, dispersion_alpha = 0.3, dispersion_color = "#3498db", dispersion_style = c("ribbon", "curve"), size_bar = 0.7, highlight = NULL, highlight_color = NULL, ... )
## S3 method for class 'see_parameters_distribution' plot( x, dispersion = FALSE, dispersion_alpha = 0.3, dispersion_color = "#3498db", dispersion_style = c("ribbon", "curve"), size_bar = 0.7, highlight = NULL, highlight_color = NULL, ... )
x |
An object. |
dispersion |
Logical. If |
dispersion_alpha |
Numeric value specifying the transparency level of dispersion ribbon. |
dispersion_color |
Character specifying the color of dispersion ribbon. |
dispersion_style |
Character describing the style of dispersion area.
|
size_bar |
Size of bar geoms. |
highlight |
A vector with names of categories in |
highlight_color |
A vector of color values for highlighted categories. The remaining (non-highlighted) categories will be filled with a lighter grey. |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(parameters) set.seed(333) x <- sample(1:100, 1000, replace = TRUE) result <- describe_distribution(x) result plot(result)
library(parameters) set.seed(333) x <- sample(1:100, 1000, replace = TRUE) result <- describe_distribution(x) result plot(result)
The plot()
method for the parameters::model_parameters()
function.
## S3 method for class 'see_parameters_model' plot( x, show_intercept = FALSE, size_point = 0.8, size_text = NA, sort = NULL, n_columns = NULL, type = c("forest", "funnel"), weight_points = TRUE, show_labels = FALSE, show_estimate = TRUE, show_interval = TRUE, show_density = FALSE, show_direction = TRUE, log_scale = FALSE, ... ) ## S3 method for class 'see_parameters_sem' plot( x, data = NULL, component = c("regression", "correlation", "loading"), type = component, threshold_coefficient = NULL, threshold_p = NULL, ci = TRUE, size_point = 22, ... )
## S3 method for class 'see_parameters_model' plot( x, show_intercept = FALSE, size_point = 0.8, size_text = NA, sort = NULL, n_columns = NULL, type = c("forest", "funnel"), weight_points = TRUE, show_labels = FALSE, show_estimate = TRUE, show_interval = TRUE, show_density = FALSE, show_direction = TRUE, log_scale = FALSE, ... ) ## S3 method for class 'see_parameters_sem' plot( x, data = NULL, component = c("regression", "correlation", "loading"), type = component, threshold_coefficient = NULL, threshold_p = NULL, ci = TRUE, size_point = 22, ... )
x |
An object. |
show_intercept |
Logical, if |
size_point |
Numeric specifying size of point-geoms. |
size_text |
Numeric value specifying size of text labels. |
sort |
The behavior of this argument depends on the plotting contexts.
|
n_columns |
For models with multiple components (like fixed and random,
count and zero-inflated), defines the number of columns for the
panel-layout. If |
type |
Character indicating the type of plot. Only applies for model parameters from meta-analysis objects (e.g. metafor). |
weight_points |
Logical. If |
show_labels |
Logical. If |
show_estimate |
Should the point estimate of each parameter be shown?
(default: |
show_interval |
Should the compatibility interval(s) of each parameter
be shown? (default: |
show_density |
Should the compatibility density (i.e., posterior,
bootstrap, or confidence density) of each parameter be shown?
(default: |
show_direction |
Should the "direction" of coefficients (e.g., positive
or negative coefficients) be highlighted using different colors?
(default: |
log_scale |
Should exponentiated coefficients (e.g., odds-ratios) be
plotted on a log scale? (default: |
... |
Arguments passed to or from other methods. |
data |
The original data used to create this object. Can be a statistical model. |
component |
Character indicating which component of the model should be plotted. |
threshold_coefficient |
Numeric, threshold at which value coefficients will be displayed. |
threshold_p |
Numeric, threshold at which value p-values will be displayed. |
ci |
Logical, whether confidence intervals should be added to the plot. |
A ggplot2-object.
By default, coefficients and their confidence intervals are colored
depending on whether they show a "positive" or "negative" association with
the outcome. E.g., in case of linear models, colors simply distinguish positive
or negative coefficients. For logistic regression models that are shown on the
odds ratio scale, colors distinguish odds ratios above or below 1. Use
show_direction = FALSE
to disable this feature and only show a one-colored
forest plot.
library(parameters) m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) result <- model_parameters(m) result plot(result)
library(parameters) m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars) result <- model_parameters(m) result plot(result)
The plot()
method for the parameters::principal_components()
function.
## S3 method for class 'see_parameters_pca' plot( x, type = c("bar", "line"), size_text = 3.5, text_color = "black", size = 1, show_labels = TRUE, ... )
## S3 method for class 'see_parameters_pca' plot( x, type = c("bar", "line"), size_text = 3.5, text_color = "black", size = 1, show_labels = TRUE, ... )
x |
An object. |
type |
Character vector, indicating the type of plot.
Options are three different shapes to represent component loadings;
|
size_text |
Numeric value specifying size of text labels. |
text_color |
Character specifying color of text labels. |
size |
Depending on |
show_labels |
Logical. If |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(parameters) data(mtcars) result <- principal_components(mtcars[, 1:7], n = "all", threshold = 0.2) result plot(result)
library(parameters) data(mtcars) result <- principal_components(mtcars[, 1:7], n = "all", threshold = 0.2) result plot(result)
The plot()
method for the parameters::simulate_parameters()
function.
## S3 method for class 'see_parameters_simulate' plot( x, data = NULL, stack = TRUE, show_intercept = FALSE, n_columns = NULL, normalize_height = FALSE, size_line = 0.9, posteriors_alpha = 0.7, centrality = "median", ci = 0.95, ... )
## S3 method for class 'see_parameters_simulate' plot( x, data = NULL, stack = TRUE, show_intercept = FALSE, n_columns = NULL, normalize_height = FALSE, size_line = 0.9, posteriors_alpha = 0.7, centrality = "median", ci = 0.95, ... )
x |
An object. |
data |
The original data used to create this object. Can be a statistical model. |
stack |
Logical. If |
show_intercept |
Logical, if |
n_columns |
For models with multiple components (like fixed and random,
count and zero-inflated), defines the number of columns for the
panel-layout. If |
normalize_height |
Logical. If |
size_line |
Numeric value specifying size of line geoms. |
posteriors_alpha |
Numeric value specifying alpha for the posterior distributions. |
centrality |
Character specifying the point-estimate (centrality index)
to compute. Can be |
ci |
Numeric value of probability of the CI (between 0 and 1) to be
estimated. Default to |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(parameters) m <<- lm(mpg ~ wt + cyl + gear, data = mtcars) result <- simulate_parameters(m) result plot(result)
library(parameters) m <<- lm(mpg ~ wt + cyl + gear, data = mtcars) result <- simulate_parameters(m) result plot(result)
The plot()
method for the performance::performance_roc()
function.
## S3 method for class 'see_performance_roc' plot(x, ...)
## S3 method for class 'see_performance_roc' plot(x, ...)
x |
An object. |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(performance) data(iris) set.seed(123) iris$y <- rbinom(nrow(iris), size = 1, .3) folds <- sample(nrow(iris), size = nrow(iris) / 8, replace = FALSE) test_data <- iris[folds, ] train_data <- iris[-folds, ] model <- glm(y ~ Sepal.Length + Sepal.Width, data = train_data, family = "binomial") result <- performance_roc(model, new_data = test_data) result plot(result)
library(performance) data(iris) set.seed(123) iris$y <- rbinom(nrow(iris), size = 1, .3) folds <- sample(nrow(iris), size = nrow(iris) / 8, replace = FALSE) test_data <- iris[folds, ] train_data <- iris[-folds, ] model <- glm(y ~ Sepal.Length + Sepal.Width, data = train_data, family = "binomial") result <- performance_roc(model, new_data = test_data) result plot(result)
The plot()
method for the performance::check_residuals()
resp.
performance::simulate_residuals()
function.
## S3 method for class 'see_performance_simres' plot( x, size_line = 0.8, size_point = 2, size_title = 12, size_axis_title = base_size, base_size = 10, alpha = 0.2, dot_alpha = 0.8, colors = c("#3aaf85", "#1b6ca8"), detrend = FALSE, transform = NULL, style = theme_lucid, ... )
## S3 method for class 'see_performance_simres' plot( x, size_line = 0.8, size_point = 2, size_title = 12, size_axis_title = base_size, base_size = 10, alpha = 0.2, dot_alpha = 0.8, colors = c("#3aaf85", "#1b6ca8"), detrend = FALSE, transform = NULL, style = theme_lucid, ... )
x |
An object. |
size_line |
Numeric value specifying size of line geoms. |
size_point |
Numeric specifying size of point-geoms. |
base_size , size_axis_title , size_title
|
Numeric value specifying size of axis and plot titles. |
alpha |
Numeric value specifying alpha level of the confidence bands. |
dot_alpha |
Numeric value specifying alpha level of the point geoms. |
colors |
Character vector of length two, indicating the colors (in hex-format) for points and line. |
detrend |
Logical that decides if Q-Q and P-P plots should be de-trended (also known as worm plots). |
transform |
Function to transform the residuals. If |
style |
A ggplot2-theme. |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
See also the vignette about check_model()
.
data(Salamanders, package = "glmmTMB") model <- glmmTMB::glmmTMB( count ~ mined + spp + (1 | site), family = poisson(), data = Salamanders ) simulated_residuals <- performance::simulate_residuals(model) plot(simulated_residuals) # or simulated_residuals <- performance::simulate_residuals(model) result <- performance::check_residuals(simulated_residuals) plot(result)
data(Salamanders, package = "glmmTMB") model <- glmmTMB::glmmTMB( count ~ mined + spp + (1 | site), family = poisson(), data = Salamanders ) simulated_residuals <- performance::simulate_residuals(model) plot(simulated_residuals) # or simulated_residuals <- performance::simulate_residuals(model) result <- performance::check_residuals(simulated_residuals) plot(result)
The plot()
method for the bayestestR::point_estimate()
.
## S3 method for class 'see_point_estimate' plot( x, data = NULL, size_point = 2, size_text = 3.5, panel = TRUE, show_labels = TRUE, show_intercept = FALSE, priors = FALSE, priors_alpha = 0.4, ... )
## S3 method for class 'see_point_estimate' plot( x, data = NULL, size_point = 2, size_text = 3.5, panel = TRUE, show_labels = TRUE, show_intercept = FALSE, priors = FALSE, priors_alpha = 0.4, ... )
x |
An object. |
data |
The original data used to create this object. Can be a statistical model. |
size_point |
Numeric specifying size of point-geoms. |
size_text |
Numeric value specifying size of text labels. |
panel |
Logical, if |
show_labels |
Logical. If |
show_intercept |
Logical, if |
priors |
Logical. If |
priors_alpha |
Numeric value specifying alpha for the prior distributions. |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(rstanarm) library(bayestestR) set.seed(123) m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- point_estimate(m, centrality = "median") result plot(result)
library(rstanarm) library(bayestestR) set.seed(123) m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- point_estimate(m, centrality = "median") result plot(result)
The plot()
method for the bayestestR::rope()
.
## S3 method for class 'see_rope' plot( x, data = NULL, rope_alpha = 0.5, rope_color = "cadetblue", show_intercept = FALSE, n_columns = 1, ... )
## S3 method for class 'see_rope' plot( x, data = NULL, rope_alpha = 0.5, rope_color = "cadetblue", show_intercept = FALSE, n_columns = 1, ... )
x |
An object. |
data |
The original data used to create this object. Can be a statistical model. |
rope_alpha |
Numeric specifying transparency level of ROPE ribbon. |
rope_color |
Character specifying color of ROPE ribbon. |
show_intercept |
Logical, if |
n_columns |
For models with multiple components (like fixed and random,
count and zero-inflated), defines the number of columns for the
panel-layout. If |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(rstanarm) library(bayestestR) set.seed(123) m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- rope(m) result plot(result)
library(rstanarm) library(bayestestR) set.seed(123) m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- rope(m) result plot(result)
The plot()
method for the bayestestR::si()
.
## S3 method for class 'see_si' plot( x, si_color = "#0171D3", si_alpha = 0.2, show_intercept = FALSE, support_only = FALSE, ... )
## S3 method for class 'see_si' plot( x, si_color = "#0171D3", si_alpha = 0.2, show_intercept = FALSE, support_only = FALSE, ... )
x |
An object. |
si_color |
Character specifying color of SI ribbon. |
si_alpha |
Numeric value specifying Transparency level of SI ribbon. |
show_intercept |
Logical, if |
support_only |
Logical. Decides whether to plot only the support data,
or show the "raw" prior and posterior distributions? Only applies when
plotting |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(rstanarm) library(bayestestR) set.seed(123) m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- si(m, verbose = FALSE) result plot(result)
library(rstanarm) library(bayestestR) set.seed(123) m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)) result <- si(m, verbose = FALSE) result plot(result)
A wrapper around patchwork to plot multiple figures side by side on the same page.
plots( ..., n_rows = NULL, n_columns = NULL, guides = NULL, tags = FALSE, tag_prefix = NULL, tag_suffix = NULL, tag_sep = NULL, title = NULL, subtitle = NULL, caption = NULL, theme = NULL )
plots( ..., n_rows = NULL, n_columns = NULL, guides = NULL, tags = FALSE, tag_prefix = NULL, tag_suffix = NULL, tag_sep = NULL, title = NULL, subtitle = NULL, caption = NULL, theme = NULL )
... |
Multiple |
n_rows |
Number of rows to align plots. |
n_columns |
Number of columns to align plots. |
guides |
A string specifying how guides should be treated in the
layout. |
tags |
Add tags to your subfigures. Can be |
tag_prefix , tag_suffix
|
Text strings that should appear before or after the tag. |
tag_sep |
Text string giving the separator to use between different tag levels. |
title , subtitle , caption
|
Text strings to use for the various plot annotations to add to the composed patchwork. |
theme |
A ggplot theme specification to use for the plot. Only elements related to titles, caption, and tags, as well as plot margin and background, are used. |
See the patchwork documentation for more advanced control of plot layouts.
library(ggplot2) library(see) p1 <- ggplot(mtcars, aes(x = disp, y = mpg)) + geom_point() p2 <- ggplot(mtcars, aes(x = mpg)) + geom_density() p3 <- ggplot(mtcars, aes(x = factor(cyl))) + geom_bar() + scale_x_discrete("cyl") plots(p1, p2) plots(p1, p2, n_columns = 2, tags = "A") plots( p1, p2, p3, n_columns = 1, tags = c("Fig. 1", "Fig. 2", "Fig. 3"), title = "The surprising truth about mtcars" )
library(ggplot2) library(see) p1 <- ggplot(mtcars, aes(x = disp, y = mpg)) + geom_point() p2 <- ggplot(mtcars, aes(x = mpg)) + geom_density() p3 <- ggplot(mtcars, aes(x = factor(cyl))) + geom_bar() + scale_x_discrete("cyl") plots(p1, p2) plots(p1, p2, n_columns = 2, tags = "A") plots( p1, p2, p3, n_columns = 1, tags = c("Fig. 1", "Fig. 2", "Fig. 3"), title = "The surprising truth about mtcars" )
The plot()
method for the performance::check_predictions()
function.
## S3 method for class 'see_performance_pp_check' print( x, size_line = 0.5, size_point = 2, size_bar = 0.7, size_axis_title = base_size, size_title = 12, base_size = 10, line_alpha = 0.15, style = theme_lucid, colors = unname(social_colors(c("green", "blue"))), type = c("density", "discrete_dots", "discrete_interval", "discrete_both"), x_limits = NULL, ... ) ## S3 method for class 'see_performance_pp_check' plot( x, size_line = 0.5, size_point = 2, size_bar = 0.7, size_axis_title = base_size, size_title = 12, base_size = 10, line_alpha = 0.15, style = theme_lucid, colors = unname(social_colors(c("green", "blue"))), type = c("density", "discrete_dots", "discrete_interval", "discrete_both"), x_limits = NULL, ... )
## S3 method for class 'see_performance_pp_check' print( x, size_line = 0.5, size_point = 2, size_bar = 0.7, size_axis_title = base_size, size_title = 12, base_size = 10, line_alpha = 0.15, style = theme_lucid, colors = unname(social_colors(c("green", "blue"))), type = c("density", "discrete_dots", "discrete_interval", "discrete_both"), x_limits = NULL, ... ) ## S3 method for class 'see_performance_pp_check' plot( x, size_line = 0.5, size_point = 2, size_bar = 0.7, size_axis_title = base_size, size_title = 12, base_size = 10, line_alpha = 0.15, style = theme_lucid, colors = unname(social_colors(c("green", "blue"))), type = c("density", "discrete_dots", "discrete_interval", "discrete_both"), x_limits = NULL, ... )
x |
An object. |
size_line |
Numeric value specifying size of line geoms. |
size_point |
Numeric specifying size of point-geoms. |
size_bar |
Size of bar geoms. |
base_size , size_axis_title , size_title
|
Numeric value specifying size of axis and plot titles. |
line_alpha |
Numeric value specifying alpha of lines indicating |
style |
A ggplot2-theme. |
colors |
Character vector of length two, indicating the colors (in hex-format) for points and line. |
type |
Plot type for the posterior predictive checks plot. Can be |
x_limits |
Numeric vector of length 2 specifying the limits of the x-axis.
If not |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
See also the vignette about check_model()
.
library(performance) model <- lm(Sepal.Length ~ Species * Petal.Width + Petal.Length, data = iris) check_predictions(model) # dot-plot style for count-models d <- iris d$poisson_var <- rpois(150, 1) model <- glm( poisson_var ~ Species + Petal.Length + Petal.Width, data = d, family = poisson() ) out <- check_predictions(model) plot(out, type = "discrete_dots")
library(performance) model <- lm(Sepal.Length ~ Species * Petal.Width + Petal.Length, data = iris) check_predictions(model) # dot-plot style for count-models d <- iris d$poisson_var <- rpois(150, 1) model <- glm( poisson_var ~ Species + Petal.Length + Petal.Width, data = d, family = poisson() ) out <- check_predictions(model) plot(out, type = "discrete_dots")
A blue-brown color palette. Use scale_color_bluebrown_d()
for
discrete categories and scale_color_bluebrown_c()
for
a continuous scale.
scale_color_bluebrown( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_bluebrown_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_bluebrown_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_bluebrown( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_bluebrown_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_bluebrown_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_bluebrown( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_bluebrown_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_bluebrown_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
scale_color_bluebrown( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_bluebrown_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_bluebrown_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_bluebrown( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_bluebrown_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_bluebrown_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_bluebrown( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_bluebrown_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_bluebrown_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
palette |
Character name of palette. Depending on the color scale, can
be |
discrete |
Boolean indicating whether color aesthetic is discrete or not. |
reverse |
Boolean indicating whether the palette should be reversed. |
aesthetics |
A vector of names of the aesthetics that this scale
should be applied to (e.g., |
... |
Additional arguments to pass to |
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_bluebrown_d()
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_bluebrown_d()
This function creates color scales based on palettes from https://www.color-hex.com/.
This website provides a large number of user-submitted color palettes.
This function downloads a requested color palette from https://www.color-hex.com/.
and creates a {ggplot2}
color scale from the provided hex codes.
Use scale_color_colorhex_d
for discrete categories and
scale_color_colorhex_c
for a continuous scale.
scale_color_colorhex( palette = 1014416, discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_colorhex_d( palette = 1014416, discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_colorhex_c( palette = 1014416, discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_colorhex( palette = 1014416, discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_colorhex_c( palette = 1014416, discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_colorhex_d( palette = 1014416, discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_colorhex( palette = 1014416, discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_colorhex_d( palette = 1014416, discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_colorhex_c( palette = 1014416, discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
scale_color_colorhex( palette = 1014416, discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_colorhex_d( palette = 1014416, discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_colorhex_c( palette = 1014416, discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_colorhex( palette = 1014416, discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_colorhex_c( palette = 1014416, discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_colorhex_d( palette = 1014416, discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_colorhex( palette = 1014416, discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_colorhex_d( palette = 1014416, discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_colorhex_c( palette = 1014416, discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
palette |
The numeric code for a palette at https://www.color-hex.com/.
For example, |
discrete |
Boolean indicating whether color aesthetic is discrete or not. |
reverse |
Boolean indicating whether the palette should be reversed. |
aesthetics |
A vector of names of the aesthetics that this scale
should be applied to (e.g., |
... |
Additional arguments to pass to |
The default Josiah color palette (number 1014416) is available without an internet connection. All other color palettes require an internet connection to download and access.
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, color = Species)) + geom_boxplot() + theme_modern() + scale_color_colorhex_d(palette = 1014416) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_colorhex_d(palette = 1014416) ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_colorhex_c(palette = 1014416)
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, color = Species)) + geom_boxplot() + theme_modern() + scale_color_colorhex_d(palette = 1014416) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_colorhex_d(palette = 1014416) ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_colorhex_c(palette = 1014416)
The palette based on Flat UI.
Use scale_color_flat_d
for discrete categories and
scale_color_flat_c
for a continuous scale.
scale_color_flat( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_flat_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_flat_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_flat( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_flat_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_flat_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_flat( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_flat_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_flat_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
scale_color_flat( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_flat_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_flat_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_flat( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_flat_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_flat_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_flat( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_flat_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_flat_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
palette |
Character name of palette. Depending on the color scale, can
be |
discrete |
Boolean indicating whether color aesthetic is discrete or not. |
reverse |
Boolean indicating whether the palette should be reversed. |
aesthetics |
A vector of names of the aesthetics that this scale
should be applied to (e.g., |
... |
Additional arguments passed to |
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_flat_d() ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_flat_d(palette = "ice") ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_flat_c(palette = "rainbow")
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_flat_d() ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_flat_d(palette = "ice") ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_flat_c(palette = "rainbow")
The palette based on material design colors. Use scale_color_material_d()
for
discrete categories and scale_color_material_c()
for a continuous
scale.
scale_color_material( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_material_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_material_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_material( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_material_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_material_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_material( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_material_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_material_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
scale_color_material( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_material_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_material_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_material( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_material_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_material_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_material( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_material_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_material_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
palette |
Character name of palette. Depending on the color scale, can
be |
discrete |
Boolean indicating whether color aesthetic is discrete or not. |
reverse |
Boolean indicating whether the palette should be reversed. |
aesthetics |
A vector of names of the aesthetics that this scale
should be applied to (e.g., |
... |
Additional arguments to pass to |
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_material_d() ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_material_d(palette = "ice") ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_material_c(palette = "rainbow")
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_material_d() ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_material_d(palette = "ice") ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_material_c(palette = "rainbow")
The palette based on Metro Metro colors.
Use scale_color_metro_d
for discrete categories and
scale_color_metro_c
for a continuous scale.
scale_color_metro( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_metro_d( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_metro_c( palette = "complement", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_metro( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_metro_c( palette = "complement", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_metro_d( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_metro( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_metro_d( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_metro_c( palette = "complement", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
scale_color_metro( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_metro_d( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_metro_c( palette = "complement", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_metro( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_metro_c( palette = "complement", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_metro_d( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_metro( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_metro_d( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_metro_c( palette = "complement", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
palette |
Character name of palette. Depending on the color scale, can
be |
discrete |
Boolean indicating whether color aesthetic is discrete or not. |
reverse |
Boolean indicating whether the palette should be reversed. |
aesthetics |
A vector of names of the aesthetics that this scale
should be applied to (e.g., |
... |
Additional arguments to pass to |
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_metro_d() ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_metro_d(palette = "ice") ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_metro_c(palette = "rainbow")
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_metro_d() ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_metro_d(palette = "ice") ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_metro_c(palette = "rainbow")
The Okabe-Ito color palette was proposed by Okabe and Ito (2008) as a qualitative color palette that is accessible to people with a variety of forms of color vision deficiency. In addition to being accessible, it includes 9 vivid colors that are readily nameable and include colors that correspond to major primary and secondary colors (e.g., red, yellow, blue).
scale_color_okabeito( palette = "full", reverse = FALSE, order = 1:9, aesthetics = "color", ... ) scale_fill_okabeito( palette = "full", reverse = FALSE, order = 1:9, aesthetics = "fill", ... ) scale_colour_okabeito( palette = "full", reverse = FALSE, order = 1:9, aesthetics = "color", ... ) scale_colour_oi( palette = "full", reverse = FALSE, order = 1:9, aesthetics = "color", ... ) scale_color_oi( palette = "full", reverse = FALSE, order = 1:9, aesthetics = "color", ... ) scale_fill_oi( palette = "full", reverse = FALSE, order = 1:9, aesthetics = "fill", ... )
scale_color_okabeito( palette = "full", reverse = FALSE, order = 1:9, aesthetics = "color", ... ) scale_fill_okabeito( palette = "full", reverse = FALSE, order = 1:9, aesthetics = "fill", ... ) scale_colour_okabeito( palette = "full", reverse = FALSE, order = 1:9, aesthetics = "color", ... ) scale_colour_oi( palette = "full", reverse = FALSE, order = 1:9, aesthetics = "color", ... ) scale_color_oi( palette = "full", reverse = FALSE, order = 1:9, aesthetics = "color", ... ) scale_fill_oi( palette = "full", reverse = FALSE, order = 1:9, aesthetics = "fill", ... )
palette |
Character name of palette. Depending on the color scale, can
be |
reverse |
Boolean indicating whether the palette should be reversed. |
order |
A vector of numbers from 1 to 9 indicating the order of colors to use
(default: |
aesthetics |
A vector of names of the aesthetics that this scale
should be applied to (e.g., |
... |
Additional arguments to pass to |
The Okabe-Ito palette is included in the base R grDevices::palette.colors()
.
These functions make this palette easier to use with ggplot2.
The original Okabe-Ito palette's "yellow" color is "#F0E442"
. This color is
very bright and often does not show up well on white backgrounds (see
here)
for a discussion of this issue). Accordingly, by default, this function uses
a darker more "amber" color for "yellow" ("#F5C710"
). This color is the
"yellow" color used in base R >4.0's default color palette.
The palettes "full"
and "black_first"
use this darker yellow color. For
the original yellow color suggested by Okabe and Ito ("#F0E442"
), use
palettes "full_original"
or "black_first_original"
.
The Okabe-Ito palette is only available as a discrete palette. For color-accessible continuous variables, consider the viridis palettes.
Okabe, M., & Ito, K. (2008). Color universal design (CUD): How to make figures and presentations that are friendly to colorblind people. https://jfly.uni-koeln.de/color/#pallet (Original work published 2002)
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_okabeito() ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_oi(palette = "black_first") # for the original brighter yellow color suggested by Okabe and Ito ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_oi(palette = "full") ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_oi(order = c(1, 5, 6, 2, 4, 3, 7))
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_okabeito() ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_oi(palette = "black_first") # for the original brighter yellow color suggested by Okabe and Ito ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_oi(palette = "full") ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_oi(order = c(1, 5, 6, 2, 4, 3, 7))
The palette based on authentic neapolitan pizzas.
Use scale_color_pizza_d()
for discrete categories and
scale_color_pizza_c()
for a continuous scale.
scale_color_pizza( palette = "margherita", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_pizza_d( palette = "margherita", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_pizza_c( palette = "margherita", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_pizza( palette = "margherita", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_pizza_c( palette = "margherita", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_pizza_d( palette = "margherita", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_pizza( palette = "margherita", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_pizza_d( palette = "margherita", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_pizza_c( palette = "margherita", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
scale_color_pizza( palette = "margherita", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_pizza_d( palette = "margherita", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_pizza_c( palette = "margherita", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_pizza( palette = "margherita", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_pizza_c( palette = "margherita", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_pizza_d( palette = "margherita", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_pizza( palette = "margherita", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_pizza_d( palette = "margherita", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_pizza_c( palette = "margherita", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
palette |
Pizza type. Can be "margherita" (default), "margherita_crust", "diavola" or "diavola_crust". |
discrete |
Boolean indicating whether color aesthetic is discrete or not. |
reverse |
Boolean indicating whether the palette should be reversed. |
aesthetics |
A vector of names of the aesthetics that this scale
should be applied to (e.g., |
... |
Additional arguments to pass to |
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_pizza_d() ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_pizza_c()
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_pizza_d() ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_pizza_c()
The See color palette. Use scale_color_see_d()
for discrete
categories and scale_color_see_c()
for a continuous scale.
scale_color_see( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_see_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_see_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_see( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_see_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_see_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_see( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_see_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_see_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
scale_color_see( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_see_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_see_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_see( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_see_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_see_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_see( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_see_d( palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_see_c( palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
palette |
Character name of palette. Depending on the color scale, can
be |
discrete |
Boolean indicating whether color aesthetic is discrete or not. |
reverse |
Boolean indicating whether the palette should be reversed. |
aesthetics |
A vector of names of the aesthetics that this scale
should be applied to (e.g., |
... |
Additional arguments to pass to |
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_see_d() ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Species)) + geom_point() + theme_abyss() + scale_colour_see(palette = "light") ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_see_c(palette = "rainbow")
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_see_d() ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Species)) + geom_point() + theme_abyss() + scale_colour_see(palette = "light") ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_see_c(palette = "rainbow")
The palette based Social colors.
Use scale_color_social_d
for discrete categories and
scale_color_social_c
for a continuous scale.
scale_color_social( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_social_d( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_social_c( palette = "complement", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_social( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_social_c( palette = "complement", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_social_d( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_social( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_social_d( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_social_c( palette = "complement", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
scale_color_social( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_social_d( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_color_social_c( palette = "complement", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_social( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_social_c( palette = "complement", discrete = FALSE, reverse = FALSE, aesthetics = "color", ... ) scale_colour_social_d( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "color", ... ) scale_fill_social( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_social_d( palette = "complement", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ... ) scale_fill_social_c( palette = "complement", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ... )
palette |
Character name of palette. Depending on the color scale, can
be |
discrete |
Boolean indicating whether color aesthetic is discrete or not. |
reverse |
Boolean indicating whether the palette should be reversed. |
aesthetics |
A vector of names of the aesthetics that this scale
should be applied to (e.g., |
... |
Additional arguments to pass to |
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_social_d() ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_social_d(palette = "ice") ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_social_c(palette = "rainbow")
library(ggplot2) library(see) ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot() + theme_modern() + scale_fill_social_d() ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_violin() + theme_modern() + scale_fill_social_d(palette = "ice") ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Sepal.Length)) + geom_point() + theme_modern() + scale_color_social_c(palette = "rainbow")
Can be used to get the hex code of specific colors from the See color
palette. Use see_colors()
to see all available colors.
see_colors(...)
see_colors(...)
... |
Character names of colors. |
A character vector with color-codes.
see_colors() see_colors("indigo", "lime")
see_colors() see_colors("indigo", "lime")
A deep dark blue theme for ggplot.
theme_abyss( base_size = 11, base_family = "", plot.title.size = 15, plot.title.face = "plain", plot.title.space = 20, plot.title.position = "plot", legend.position = "right", axis.title.space = 20, legend.title.size = 13, legend.text.size = 12, axis.title.size = 13, axis.title.face = "plain", axis.text.size = 12, axis.text.angle = NULL, tags.size = 15, tags.face = "bold" )
theme_abyss( base_size = 11, base_family = "", plot.title.size = 15, plot.title.face = "plain", plot.title.space = 20, plot.title.position = "plot", legend.position = "right", axis.title.space = 20, legend.title.size = 13, legend.text.size = 12, axis.title.size = 13, axis.title.face = "plain", axis.text.size = 12, axis.text.angle = NULL, tags.size = 15, tags.face = "bold" )
base_size |
base font size, given in pts. |
base_family |
base font family |
plot.title.size |
Title size in pts. Can be "none". |
plot.title.face |
Title font face ("plain", "italic", "bold", "bold.italic"). |
plot.title.space |
Title spacing. |
plot.title.position |
Alignment of the plot title/subtitle and caption. The setting for plot.title.position applies to both the title and the subtitle. A value of "panel" (the default) means that titles and/or caption are aligned to the plot panels. A value of "plot" means that titles and/or caption are aligned to the entire plot (minus any space for margins and plot tag). |
legend.position |
the default position of legends ("none", "left", "right", "bottom", "top", "inside") |
axis.title.space |
Axis title spacing. |
legend.title.size |
Legend elements text size in pts. |
legend.text.size |
Legend elements text size in pts. Can be "none". |
axis.title.size |
Axis title text size in pts. |
axis.title.face |
Axis font face ("plain", "italic", "bold", "bold.italic"). |
axis.text.size |
Axis text size in pts. |
axis.text.angle |
Rotate the x axis labels. |
tags.size |
Tags text size in pts. |
tags.face |
Tags font face ("plain", "italic", "bold", "bold.italic"). |
library(ggplot2) library(see) ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + geom_point(color = "white") + theme_abyss()
library(ggplot2) library(see) ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + geom_point(color = "white") + theme_abyss()
A modern, sleek and dark theme for ggplot.
theme_blackboard( base_size = 11, base_family = "", plot.title.size = 15, plot.title.face = "plain", plot.title.space = 20, plot.title.position = "plot", legend.position = "right", axis.title.space = 20, legend.title.size = 13, legend.text.size = 12, axis.title.size = 13, axis.title.face = "plain", axis.text.size = 12, axis.text.angle = NULL, tags.size = 15, tags.face = "bold" )
theme_blackboard( base_size = 11, base_family = "", plot.title.size = 15, plot.title.face = "plain", plot.title.space = 20, plot.title.position = "plot", legend.position = "right", axis.title.space = 20, legend.title.size = 13, legend.text.size = 12, axis.title.size = 13, axis.title.face = "plain", axis.text.size = 12, axis.text.angle = NULL, tags.size = 15, tags.face = "bold" )
base_size |
base font size, given in pts. |
base_family |
base font family |
plot.title.size |
Title size in pts. Can be "none". |
plot.title.face |
Title font face ("plain", "italic", "bold", "bold.italic"). |
plot.title.space |
Title spacing. |
plot.title.position |
Alignment of the plot title/subtitle and caption. The setting for plot.title.position applies to both the title and the subtitle. A value of "panel" (the default) means that titles and/or caption are aligned to the plot panels. A value of "plot" means that titles and/or caption are aligned to the entire plot (minus any space for margins and plot tag). |
legend.position |
the default position of legends ("none", "left", "right", "bottom", "top", "inside") |
axis.title.space |
Axis title spacing. |
legend.title.size |
Legend elements text size in pts. |
legend.text.size |
Legend elements text size in pts. Can be "none". |
axis.title.size |
Axis title text size in pts. |
axis.title.face |
Axis font face ("plain", "italic", "bold", "bold.italic"). |
axis.text.size |
Axis text size in pts. |
axis.text.angle |
Rotate the x axis labels. |
tags.size |
Tags text size in pts. |
tags.face |
Tags font face ("plain", "italic", "bold", "bold.italic"). |
library(ggplot2) library(see) ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + geom_point(color = "white") + theme_blackboard()
library(ggplot2) library(see) ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + geom_point(color = "white") + theme_blackboard()
A light, clear theme for ggplot.
theme_lucid( base_size = 11, base_family = "", plot.title.size = 12, plot.title.face = "plain", plot.title.space = 15, plot.title.position = "plot", legend.position = "right", axis.title.space = 10, legend.title.size = 11, legend.text.size = 10, axis.title.size = 11, axis.title.face = "plain", axis.text.size = 10, axis.text.angle = NULL, tags.size = 11, tags.face = "plain" )
theme_lucid( base_size = 11, base_family = "", plot.title.size = 12, plot.title.face = "plain", plot.title.space = 15, plot.title.position = "plot", legend.position = "right", axis.title.space = 10, legend.title.size = 11, legend.text.size = 10, axis.title.size = 11, axis.title.face = "plain", axis.text.size = 10, axis.text.angle = NULL, tags.size = 11, tags.face = "plain" )
base_size |
base font size, given in pts. |
base_family |
base font family |
plot.title.size |
Title size in pts. Can be "none". |
plot.title.face |
Title font face ("plain", "italic", "bold", "bold.italic"). |
plot.title.space |
Title spacing. |
plot.title.position |
Alignment of the plot title/subtitle and caption. The setting for plot.title.position applies to both the title and the subtitle. A value of "panel" (the default) means that titles and/or caption are aligned to the plot panels. A value of "plot" means that titles and/or caption are aligned to the entire plot (minus any space for margins and plot tag). |
legend.position |
the default position of legends ("none", "left", "right", "bottom", "top", "inside") |
axis.title.space |
Axis title spacing. |
legend.title.size |
Legend elements text size in pts. |
legend.text.size |
Legend elements text size in pts. Can be "none". |
axis.title.size |
Axis title text size in pts. |
axis.title.face |
Axis font face ("plain", "italic", "bold", "bold.italic"). |
axis.text.size |
Axis text size in pts. |
axis.text.angle |
Rotate the x axis labels. |
tags.size |
Tags text size in pts. |
tags.face |
Tags font face ("plain", "italic", "bold", "bold.italic"). |
library(ggplot2) library(see) ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + geom_point(color = "white") + theme_lucid()
library(ggplot2) library(see) ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) + geom_point(color = "white") + theme_lucid()
A modern, sleek and elegant theme for ggplot.
theme_modern( base_size = 11, base_family = "", plot.title.size = 15, plot.title.face = "plain", plot.title.space = 20, plot.title.position = "plot", legend.position = "right", axis.title.space = 20, legend.title.size = 13, legend.text.size = 12, axis.title.size = 13, axis.title.face = "plain", axis.text.size = 12, axis.text.angle = NULL, tags.size = 15, tags.face = "bold" )
theme_modern( base_size = 11, base_family = "", plot.title.size = 15, plot.title.face = "plain", plot.title.space = 20, plot.title.position = "plot", legend.position = "right", axis.title.space = 20, legend.title.size = 13, legend.text.size = 12, axis.title.size = 13, axis.title.face = "plain", axis.text.size = 12, axis.text.angle = NULL, tags.size = 15, tags.face = "bold" )
base_size |
base font size, given in pts. |
base_family |
base font family |
plot.title.size |
Title size in pts. Can be "none". |
plot.title.face |
Title font face ("plain", "italic", "bold", "bold.italic"). |
plot.title.space |
Title spacing. |
plot.title.position |
Alignment of the plot title/subtitle and caption. The setting for plot.title.position applies to both the title and the subtitle. A value of "panel" (the default) means that titles and/or caption are aligned to the plot panels. A value of "plot" means that titles and/or caption are aligned to the entire plot (minus any space for margins and plot tag). |
legend.position |
the default position of legends ("none", "left", "right", "bottom", "top", "inside") |
axis.title.space |
Axis title spacing. |
legend.title.size |
Legend elements text size in pts. |
legend.text.size |
Legend elements text size in pts. Can be "none". |
axis.title.size |
Axis title text size in pts. |
axis.title.face |
Axis font face ("plain", "italic", "bold", "bold.italic"). |
axis.text.size |
Axis text size in pts. |
axis.text.angle |
Rotate the x axis labels. |
tags.size |
Tags text size in pts. |
tags.face |
Tags font face ("plain", "italic", "bold", "bold.italic"). |
library(ggplot2) library(see) ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length, color = Species)) + geom_point() + theme_modern()
library(ggplot2) library(see) ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length, color = Species)) + geom_point() + theme_modern()
theme_radar()
is a light, clear theme for ggplot radar-plots, while
theme_radar_dark()
is a dark variant of theme_radar()
.
theme_radar( base_size = 11, base_family = "", plot.title.size = 12, plot.title.face = "plain", plot.title.space = 15, plot.title.position = "plot", legend.position = "right", axis.title.space = 15, legend.title.size = 11, legend.text.size = 10, axis.title.size = 11, axis.title.face = "plain", axis.text.size = 10, axis.text.angle = NULL, tags.size = 11, tags.face = "plain" ) theme_radar_dark( base_size = 11, base_family = "", plot.title.size = 12, plot.title.face = "plain", plot.title.space = 15, legend.position = "right", axis.title.space = 15, legend.title.size = 11, legend.text.size = 10, axis.title.size = 11, axis.title.face = "plain", axis.text.size = 10, axis.text.angle = NULL, tags.size = 11, tags.face = "plain" )
theme_radar( base_size = 11, base_family = "", plot.title.size = 12, plot.title.face = "plain", plot.title.space = 15, plot.title.position = "plot", legend.position = "right", axis.title.space = 15, legend.title.size = 11, legend.text.size = 10, axis.title.size = 11, axis.title.face = "plain", axis.text.size = 10, axis.text.angle = NULL, tags.size = 11, tags.face = "plain" ) theme_radar_dark( base_size = 11, base_family = "", plot.title.size = 12, plot.title.face = "plain", plot.title.space = 15, legend.position = "right", axis.title.space = 15, legend.title.size = 11, legend.text.size = 10, axis.title.size = 11, axis.title.face = "plain", axis.text.size = 10, axis.text.angle = NULL, tags.size = 11, tags.face = "plain" )
base_size |
base font size, given in pts. |
base_family |
base font family |
plot.title.size |
Title size in pts. Can be "none". |
plot.title.face |
Title font face ("plain", "italic", "bold", "bold.italic"). |
plot.title.space |
Title spacing. |
plot.title.position |
Alignment of the plot title/subtitle and caption. The setting for plot.title.position applies to both the title and the subtitle. A value of "panel" (the default) means that titles and/or caption are aligned to the plot panels. A value of "plot" means that titles and/or caption are aligned to the entire plot (minus any space for margins and plot tag). |
legend.position |
the default position of legends ("none", "left", "right", "bottom", "top", "inside") |
axis.title.space |
Axis title spacing. |
legend.title.size |
Legend elements text size in pts. |
legend.text.size |
Legend elements text size in pts. Can be "none". |
axis.title.size |
Axis title text size in pts. |
axis.title.face |
Axis font face ("plain", "italic", "bold", "bold.italic"). |
axis.text.size |
Axis text size in pts. |
axis.text.angle |
Rotate the x axis labels. |
tags.size |
Tags text size in pts. |
tags.face |
Tags font face ("plain", "italic", "bold", "bold.italic"). |
data <- datawizard::reshape_longer( aggregate(iris[-5], list(Species = iris$Species), mean), c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width") ) ggplot( data, aes( x = name, y = value, color = Species, group = Species, fill = Species ) ) + geom_polygon(linewidth = 1, alpha = 0.1) + coord_radar() + theme_radar()
data <- datawizard::reshape_longer( aggregate(iris[-5], list(Species = iris$Species), mean), c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width") ) ggplot( data, aes( x = name, y = value, color = Species, group = Species, fill = Species ) ) + geom_polygon(linewidth = 1, alpha = 0.1) + coord_radar() + theme_radar()
Extract Social colors as hex codes
Description
Can be used to get the hex code of specific colors from the Social color palette. Use
social_colors()
to see all available colors.Usage
Arguments
...
Character names of colors.
Value
A character vector with color-codes.
Examples