contour.loca.p {orloca} | R Documentation |
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 class '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),
...
)
Arguments
x |
The loca.p object to compute the objective. |
lp |
If given, then |
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.
Value
contour.loca.p
plots a contour plot of min-sum function (distsum
).
See Also
See also orloca-package
, plot.loca.p
and loca.p
.
Examples
# 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)