Learn R Programming

GEOmap (version 2.1)

geoLEGEND: Geological legend from GEOmap Structure

Description

Create and add Geological legend from GEOmap Structure

Usage

geoLEGEND(names, shades, zx, zy, nx, ny)

Arguments

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

Value

  • Graphical Side Effects

Details

Adds geological legend based on information provided. Legend is placed in margin

Examples

Run this code
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)

Run the code above in your browser using DataLab