
Last chance! 50% off unlimited learning
Sale ends in
plot_fn
is a function that uses parameters for plotting a plot.
plot_fn(
x = NA,
y = 1,
A = TRUE,
B = FALSE,
C = TRUE,
D = FALSE,
E = FALSE,
F = FALSE,
f = c(rev(pal_seeblau), "white", pal_pinky),
g = "white"
)
Numeric (integer > 0).
Default: x = NA
.
Numeric (double).
Default: y = 1
.
Boolean.
Default: A = TRUE
.
Boolean.
Default: B = FALSE
.
Boolean.
Default: C = TRUE
.
Boolean.
Default: D = FALSE
.
Boolean.
Default: E = FALSE
.
Boolean.
Default: F = FALSE
.
A color palette (as a vector).
Default: f = c(rev(pal_seeblau), "white", pal_pinky)
.
Note: Using colors of the unikn
package by default.
A color (e.g., a color name, as a character).
Default: g = "white"
.
plot_fn
is deliberately kept cryptic and obscure to illustrate
how function parameters can be explored.
plot_fn
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_fn
currently requires pal_seeblau
and
pal_pinky
(from the unikn package) for its default colors.
plot_fun
for a related function;
pal_ds4psy
for a color palette.
Other plot functions:
plot_charmap()
,
plot_chars()
,
plot_fun()
,
plot_n()
,
plot_text()
,
plot_tiles()
,
theme_clean()
,
theme_ds4psy()
,
theme_empty()
# Basics:
plot_fn()
# Exploring options:
plot_fn(x = 2, A = TRUE)
plot_fn(x = 3, A = FALSE, E = TRUE)
plot_fn(x = 4, A = TRUE, B = TRUE, D = TRUE)
plot_fn(x = 5, A = FALSE, B = TRUE, E = TRUE, f = c("black", "white", "gold"))
plot_fn(x = 7, A = TRUE, B = TRUE, F = TRUE, f = c("steelblue", "white", "forestgreen"))
Run the code above in your browser using DataLab