Plot a test function in 2D.

Share:

Description

Plot a test function in 2D.

Usage

1
2
3
4
5
6
7
8
  ## S3 method for class 'soo_function'
 plot(x, lower = lower_bounds(x),
    upper = upper_bounds(x), n = 10000L,
    main = function_name(x), xlab = expression(x[1]),
    ylab = expression(x[2]), log = FALSE, rank = FALSE,
    show = c("image", "contour"), ...,
    image_args = list(useRaster = TRUE),
    contour_args = list())

Arguments

x

Function to plot.

lower

Lower bounds of x1 and x2.

upper

Upper bounds of x1 and x2.

n

Number of locations at which to sample the function.

xlab

Label of x (x1) axes.

ylab

Label of y (x2) axes.

main

Main title of plot.

log

If TRUE, the z axes is plotted on log scale.

rank

If TRUE, instead of the y values, their ranks are drawn.

show

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

...

Ignored.

image_args

List of further arguments passed to image().

contour_args

List of further arguments passed to contour().

Author(s)

Olaf Mersmann olafm@datensplitter.net

Examples

1
2
3
4
5
6
par(mfrow=c(2, 2))
f <- sphere_function(2)
plot(f)
plot(f, show="contour")
plot(f, rank=TRUE)
plot(f, log=TRUE)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.