surface_plot: Make an interactive plotly plot of a function of two...

View source: R/interactive_plot.R

surface_plotR Documentation

Make an interactive plotly plot of a function of two variables

Description

An interactive plot lets you interrogate the plot to get numerical values at each point. When type = "surface", the plot can be rotated to see the "shape" of the function from various perspectives. Using the interactive controls, you can save the plot as a PNG file. But it's not possible to overlay plots the way you can with contourPlot().

Usage

surface_plot(
  formula,
  domain = c(-5, 5),
  npts = 50,
  type = c("both", "surface", "contour", "heatmap")
)

interactive_plot(
  formula,
  domain = c(-5, 5),
  npts = 50,
  type = c("both", "surface", "contour", "heatmap")
)

surface_with_contours(formula, domain = c(-5, 5), npts = 50)

Arguments

formula

a formula describing a function in the manner of mosaicCalc::makeFun()

domain

a call to the domain() function giving ranges using the same independent variables as in the formula

npts

The fineness at which to evaluate the function specified by the formula in the plot. Default: 50

type

Plot type: "surface", "contour", "both", or "heatmap"

Examples

## Not run: 
interactive_plot(
    sin(fred*ginger) ~ fred + ginger,
    domain(fred=range(0,pi),
           ginger = range(0, pi)),
    type = "both")

## End(Not run)


mosaicCalc documentation built on Sept. 15, 2022, 9:06 a.m.