Skip to contents

Plots a single gradient trajectory with ascending and descending paths.

Usage

gradient.trajectory.plot(
  grid,
  trajectory,
  ascending.color = "orange",
  descending.color = "purple",
  line.width = 2,
  add = FALSE,
  ...
)

Arguments

grid

Grid object from create.grid

trajectory

Trajectory object from compute.gradient.trajectory

ascending.color

Color for ascending path (default "orange")

descending.color

Color for descending path (default "purple")

line.width

Line width (default 2)

add

Logical, whether to add to existing plot

...

Additional arguments passed to plot

Value

Invisible NULL

Examples

if (FALSE) { # \dontrun{
grid <- create.grid(30)
f <- function(x, y) -((x-0.5)^2 + (y-0.5)^2)
f.grid <- evaluate.function.on.grid(f, grid)
traj <- compute.gradient.trajectory(15, 15, f.grid)
gradient.trajectory.plot(grid, traj)
} # }