plot_fun: An example function to plot some plot

View source: R/plot_fun.R

plot_funR Documentation

An example function to plot some plot

Description

plot_fun provides options for plotting a plot.

Usage

plot_fun(
  a = NA,
  b = TRUE,
  c = TRUE,
  d = 1,
  e = FALSE,
  f = FALSE,
  g = FALSE,
  c1 = c(rev(pal_seeblau), "white", pal_grau, "black", Bordeaux),
  c2 = "black"
)

Arguments

a

Numeric (integer > 0). Default: a = NA.

b

Boolean. Default: b = TRUE.

c

Boolean. Default: c = TRUE.

d

Numeric (double). Default: d = 1.0.

e

Boolean. Default: e = FALSE.

f

Boolean. Default: f = FALSE.

g

Boolean. Default: g = FALSE.

c1

A color palette (as a vector). Default: c1 = c(rev(pal_seeblau), "white", pal_grau, "black", Bordeaux) (i.e., using colors of the unikn package by default).

c2

A color (e.g., color name, as character). Default: c2 = "black".

Details

plot_fun is deliberately kept cryptic and obscure to illustrate how function parameters can be explored.

plot_fun also shows that brevity in argument names should not come at the expense of clarity. In fact, transparent argument names are absolutely essential for understanding and using a function.

plot_fun currently requires pal_seeblau, pal_grau, and Bordeaux (from the unikn package) for its default colors.

See Also

plot_fn for a related function; pal_ds4psy for color palette.

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

Examples

# Basics: 
plot_fun()

# Exploring options: 
plot_fun(a = 3, b = FALSE, e = TRUE)
plot_fun(a = 4, f = TRUE, g = TRUE, c1 = c("steelblue", "white", "firebrick"))


hneth/ds4psy documentation built on May 1, 2024, 4:26 a.m.