plot.grassmeta {GRASS} | R Documentation |
plot.grassmeta provides a simple interface between grass data objects and the image()
function; category layers may be plotted by taking unclass()
of the layer, and setting zlim to non-default values. If layer is not set, a blank base map is plotted, for instance for use with points()
.
## S3 method for class 'grassmeta': plot(x, layer=NULL, xlab="", ylab="", reverse=NULL, add=FALSE, breaks=NULL, ...) legtext(break.levels) leglabs(x1, under="under", over="over", between="-")
x |
GRASS metadata from gmeta() |
layer |
GRASS-ordered raster layer passed on to image() |
xlab |
a title for the x axis, passed to plot() |
ylab |
a title for the y axis, passed to plot() |
reverse |
see help(reverse) |
add |
FALSE for new plot, TRUE to overlay layer on prior plot |
... |
parameters passed through to image() |
break.levels |
vector of image break levels |
breaks |
vector of image break levels |
x1 |
in leglabs(), a vector of breaks |
under |
character value to denote under |
over |
character value to denote over |
between |
character value to denote between |
The function uses asp=1
from the plot.window()
function to
ensure that the scales chosen to be equal on both axes, that is 1cm represents
the same units on each. The legtext
function is a small helper to aid
in converting image break levels into legend texts, taking a numeric argument
as image(break=)
, and returning a character vector.
none
The functions in this package are intended to work with the GRASS geographical information system. The examples for wrapper functions will will work whether or not R is running in GRASS, and whether or not the current location is that of the data set used for the examples. Examples of interface functions will however (from version 0.2-2) only work outside GRASS, to avoid possible overwriting of GRASS database locations and/or files.
Roger S. Bivand, e-mail: Roger.Bivand@nhh.no.
http://grass.itc.it/statsgrass/index.html, Bivand, R. S., (2000) Using the R statistical data analysis language on GRASS 5.0 GIS data base files. Computers and Geosciences, 26, pp. 1043-1052.
data(utm.maas) Zn.o <- as.ordered(cut(utm.maas$Zn, labels=c("insignificant", "low", "medium", "high", "crisis"), breaks=c(100, 200, 400, 700, 1000, 2000), include.lowest=TRUE)) G <- maas.metadata plot(G) points(utm.maas$east, utm.maas$north, pch=unclass(Zn.o)) legend(x=c(269800, 270500), y=c(5652300, 5653000), pch=c(1:5), legend=levels(Zn.o)) title("Note equal east and north scales") example(kde2d.G)