Learn R Programming

orloca (version 5.6)

contour.loca.p: Plots of the min-sum objective function

Description

contour provides a graphical representations of min-sum objective function, which is the weighted sum of the distances to demand points (distsum).

Usage

# S3 method for loca.p
contour(
  x,
  lp = numeric(0),
  xmin = min(min(x@x), xleft),
  xmax = max(max(x@x), xright),
  ymin = min(min(x@y), ybottom),
  ymax = max(max(x@y), ytop),
  n = 100,
  img = NULL,
  xleft = min(x@x),
  ybottom = min(x@y),
  xright = max(x@x),
  ytop = max(x@y),
  ...
)

Value

contour.loca.p plots a contour plot of min-sum function (distsum).

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.

n

The number of divisions for grid.

img

A raster image to plot on background.

xleft

The left position of the image.

ybottom

The bottom position of the image.

xright

The right position of the image.

ytop

The top position of the image.

...

Other options.

Details

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

See Also

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

Examples

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

# The contour plot of min-sum function for loca (a loca.p object)
contour(loca)

Run the code above in your browser using DataLab