Horizontal Zebra Scale

Description

Plot a zebra style horizontal scale on a projected map.

Usage

1
2
zebra(x, y, Dx, dx, dy, lab = "", pos=1, col = c("black", "white"),
cex = 1, textcol="black", xpd=TRUE, PMAT = NULL)

Arguments

x

x-coordinate of left corner

y

y-coordinate of left corner

Dx

distance in x, km

dx

distance for zebra stripes in x

dy

thickness in km

lab

labels

pos

position of text, 1=below, 3=above, as in par

col

2-vector of colors, for the alternating bars

cex

character expansion

textcol

color for the text

xpd

logical, graphic parameter for clipping (see par)

PMAT

3D projection matrix from persp

Details

Plots a zebra style kilometer scale on the current plot

Value

Graphical Side effect

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(geomapdata)

data(USAmap)
USALL=list()
USALL$lat=c(24.72853,49.62741)
USALL$lon=c(229.29389,296.41803)
## set UTM projection
PROJ = setPROJ(type = 2, LAT0 =mean(USALL$lat), LON0 = mean(USALL$lon) )

####  plot with UTM  projection:
plotGEOmapXY(USAmap, LIM= c(USALL$lon[1], USALL$lat[1],
     USALL$lon[2], USALL$lat[2]    )  , PROJ=PROJ, add=FALSE, shiftlon=0)

zeb=list()
zeb$x=c(197.727896066)
zeb$y=c(-1155.81158234)

zebra(zeb$x[1],zeb$y[1], 1000, 100, 60, lab="Km", cex=.6)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.