plot.owin(x, main, add=FALSE, ..., box=TRUE, edge=0.04)
TRUE
, draw the window in
the current plot; if FALSE
, generate a new plot.plot
function.TRUE
, plot the enclosing rectangular box1 + edge
times as large as the limits of the rectangular box
that encloses the pattern.plot
method for the class owin
.
The action is to plot the boundary of the window on the current plot device,
using equal scales on the x
and y
axes. If the window x
is of type "rectangle"
or "polygonal"
,
the boundary of the window is plotted as a polygon or series of polygons.
If x
is of type "mask"
the discrete raster approximation of the window is displayed
as a binary image (white inside the window, black outside).
Graphical parameters controlling the display (e.g. setting the
colours) may be passed directly via the ...
arguments,
or indirectly reset using
spatstat.options
.
The parameter par.binary
of spatstat.options
controls the display when x
is of type "mask"
.
owin.object
,
plot.ppp
,
spatstat.options
# rectangular window
data(nztrees)
plot(nztrees$window)
abline(v=148, lty=2)
# polygonal window
plot(c(0,1),c(0,1),type="n")
bdry <- locator()
# click the vertices of a polygon (anticlockwise)
w <- owin(c(0,1), c(0,1), poly=bdry)
plot(w)
# binary mask
we <- erode.owin(w, 0.05, FALSE)
plot(we)
spatstat.options(par.binary=list(col=grey(c(0.5,1))))
plot(we)
Run the code above in your browser using DataLab