Npoints = 20
set.seed(0)
myPoints = vect(
cbind(runif(Npoints)-0.1, 51+runif(Npoints)),
atts=data.frame(
y1=c(NA, rnorm(Npoints-1)),
y2=c(sample(0:5, Npoints-1,replace=TRUE), NA)
),
crs=crsLL)
breaks = c(-100, -1, 1, Inf)
thecol = c('red','orange','blue')
oldpar = map.new(myPoints)
plot(myPoints,col = as.character(cut(
myPoints$y1, breaks, thecol
)),add=TRUE)
scaleBar(myPoints, "bottomright",cex=1.25, seg.len=2)
legendBreaks("topleft", legend=breaks, col=thecol)
thedot = insetMap(crs=myPoints,
pos="bottomleft",
col='#00000000', lty=0, outer=FALSE, width=0.25)
points(thedot)
par(oldpar)
Run the code above in your browser using DataLab