cf_data: Contour plot from data

View source: R/cf_data.R

cf_dataR Documentation

Contour plot from data

Description

Makes filled contour plot from data without sidebar by interpolating with a Gaussian process model. The model is passed to cf_func to make the contour plot.

Usage

cf_data(
  x,
  y = NULL,
  z = NULL,
  xlim = NULL,
  ylim = NULL,
  xylim = NULL,
  fit = "",
  gg = FALSE,
  show_points,
  family = "gaussian",
  ...
)

Arguments

x

either just x data, x and y data, or x, y and z data

y

either y data, z data, or null

z

either z data or null

xlim

x limits for the contour plot, will be set to data limits +- 5% if not specified

ylim

y limits for the contour plot, will be set to data limits +- 5% if not specified

xylim

x and y limits for the contour plot

fit

Method to fit a model with. Current options are laGP (default), mlegp, gam (uses mgcv), and locfit. laGP is faster but might cause trouble.

gg

If TRUE, will use ggplot2 by calling gcf_func

show_points

Whether the input data points should be shown on the plot. If missing, is TRUE when there are more than 300 points.

family

The distribution/link to be used in fitting. Only available when fit is locfit or mgcv.

...

passed to cf_func

Examples

x <- runif(20)
y <- runif(20)
z <- exp(-(x-.5)^2-5*(y-.5)^2)
cf_data(x,y,z)

CollinErickson/ContourFunctions documentation built on Sept. 17, 2024, 8:48 p.m.