persp: Plots of the min-sum objective function

perspR Documentation

Plots of the min-sum objective function

Description

persp and persp3d provide a graphical 3D representations of objetive function of the min-sum problem, which is the total weighted distance to the demand points (distsum).

Usage

## S3 method for class 'loca.p'
persp(
  x,
  lp = numeric(0),
  xmin = min(x@x),
  xmax = max(x@x),
  ymin = min(x@y),
  ymax = max(x@y),
  xlab = "",
  ylab = "",
  zlab = "",
  n = 10,
  ticktype = "detailed",
  ...
)

persp3d(x, ...)

persp3d.loca.p(
  x,
  lp = numeric(0),
  xmin = min(x@x),
  xmax = max(x@x),
  ymin = min(x@y),
  ymax = max(x@y),
  xlab = "",
  ylab = "",
  zlab = "",
  n = 10,
  ticktype = "detailed",
  ...
)

Arguments

x

The loca.p object to compute the objective.

lp

If given, then l_p norm will be used instead of the Euclidean norm.

xmin

The minimum value for x axis.

xmax

The maximum value for x axis.

ymin

The minimum value for y axis.

ymax

The maximum value for y axis.

xlab

The label for x axis.

ylab

The label for y axis.

zlab

The label for z axis.

n

The number of divisions for grid.

ticktype

parameter to pass to low level function persp

...

Other options.

Details

If p<1 then l_p is not a norm, so only p>=1 are valid values.

Value

A 3D plot of min-sum function.

See Also

See also orloca-package, plot.loca.p, loca.p, persp and persp3d.

Examples

# A new unweighted loca.p object
loca <- loca.p(x = c(-1, 1, 1, -1), y = c(-1, -1, 1, 1))

# 3D plot
persp(loca)

# Interactive 3D plot
persp3d(loca)


orloca documentation built on April 27, 2026, 3:01 a.m.