Learn R Programming

mosaicCalc (version 0.6.4)

slice_plot: Plot a function of a single variable

Description

In a slice plot, there is one independent variable. The graph shows the output of the function versus the independent variable. It's called a slice plot to distinguish it from a contour plot, in which the graph has one axis for each independent variable and the output of the function is shown by color and labels.

Usage

slice_plot(
  ...,
  npts = 101,
  color = "black",
  alpha = 1,
  label_text = "",
  label_x = 1,
  label_vjust = "top",
  label_color = color,
  label_alpha = alpha,
  singularities = numeric(0)
)

Value

ggplot2 layers

Arguments

...

Canonical first three argument: [gg], tilde expression, [domain] as well as any parameters to be assigned or re-assigned.

npts

Integer, number of points at which to evaluate the function.

color

Color of curve

alpha

Alpha of curve

label_text

character string label to place near the graph curve. Default: none.

label_x

number between 0 and 1 indicating the horizontal placement of the label_text.

label_vjust

vertical justification of label. One of "left", "middle", "right", "bottom", "center", "top", "inward", or "outward"

label_color

color of label

label_alpha

alpha of label

singularities

numeric vector of x positions at which to break the graph.

Additional arguments will be passed to geom_line(). Use, e.g. color="red"