| geoLEGEND {GEOmap} | R Documentation |
Create and add Geological legend from GEOmap Structure
geoLEGEND(names, shades, zx, zy, nx, ny)
names |
namesof units |
shades |
colorsof units |
zx |
width of box, mm |
zy |
height of box, mm |
nx |
number of boxes in x-direction |
ny |
number of boxes in y-direction |
Adds geological legend based on information provided. Legend is placed in margin
Graphical Side Effects
If plot is resized, should re-run this as the units depend on the screen size information and the transformation of user coordinates.
Jonathan M. Lees<jonathan.lees@unc.edu>
## Not run:
data(cosogeol)
data(cosomap)
data(faults)
data(hiways)
data(owens)
proj = cosomap$PROJ
plotGEOmapXY(cosomap, PROJ=proj, add=FALSE, ann=FALSE, axes=FALSE)
plotGEOmapXY(cosogeol, PROJ=proj, add=TRUE, ann=FALSE, axes=FALSE)
setXMCOL()
newcol = XMCOL[cosogeol$STROKES$col+1]
cosocolnums = cosogeol$STROKES$col
cosogeol$STROKES$col = newcol
ss = strsplit(cosogeol$STROKES$nam, split="_")
geo = unlist(lapply(ss , FUN="getmem", mem=1))
UGEO = unique(geo)
mgeo = match( geo, UGEO )
gcol = paste(sep=".", geo, cosogeol$STROKES$col)
ucol = unique(gcol)
N = length(ucol)
spucol = strsplit(ucol,split="\.")
names = unlist(lapply(spucol , FUN="getmem", mem=1))
shades = unlist(lapply(spucol , FUN="getmem", mem=2))
ORDN = order(names)
geoLEGEND(names[ORDN], shades[ORDN], .28, .14, 16, 6)
## End(Not run)