Learn R Programming

soobench (version 1.9.18)

plot_2d_soo_function: Plot a test function in 2D.

Description

Plot a test function in 2D.

Usage

plot_2d_soo_function(
  fn,
  lower = lower_bounds(fn),
  upper = upper_bounds(fn),
  n = 10000L,
  main = function_name(fn),
  xlab = expression(x[1]),
  ylab = expression(x[2]),
  log = FALSE,
  rank = FALSE,
  asp = 1,
  show = c("image", "contour"),
  image_args = list(useRaster = TRUE),
  contour_args = list(),
  ...
)

Arguments

fn

[soo_function] Function to plot.

lower

[numeric] Lower bounds of x1 and x2.

upper

[numeric] Upper bounds of x1 and x2.

n

[integer(1)] Number of locations at which to sample the function.

main

[character(1)] Main title of plot.

xlab

[character(1)] Label of x (x1) axes.

ylab

[character(1)] Label of y (x2) axes.

log

[boolean(1)] If TRUE, the z axes is plotted on log scale.

rank

[boolean(1)] If TRUE, instead of the y values, their ranks are drawn.

asp

[numeric(1)] Aspect ratio of plot. Defaults to 1.

show

[character] A vector of parts to plot. Defaults to c("image", "contour") and can be any subset.

image_args

[list] List of further arguments passed to image().

contour_args

[list] List of further arguments passed to contour().

...

Ignored.

Examples

Run this code
# NOT RUN {
par(mfrow=c(2, 2))
fn <- generate_sphere_function(2)
plot(fn)
plot(fn, show="contour")
plot(fn, rank=TRUE)
plot(fn, log=TRUE)
# }

Run the code above in your browser using DataLab