Olá todos,

Estou produzindo mapas de nível topográfico com o Lattice, usando as funções levelplot() e contourplot(). Depois de pronto, tento colocar pontos no mapa, usando points() e não funciona. Se alguém souber onde está o erro, agradeço qualquer ajudar.

Att
Carlos



o código é o seguinte:


elevation.loess = loess(z ~ x*y, data=data.s, degree = 2, span = .3, 
family="gaussian")

elevation.fit = expand.grid(list(x = seq(65.86,71.6,0.01), 
y = seq(1.81,6.845,0.01)))

z = predict(elevation.loess, newdata = elevation.fit)

z1<-ifelse(z<0,0,z)

height<-(elevation.fit$Height = as.numeric(z1))

library(lattice)

levelplot(height~-x*-y, data = elevation.fit,
 xlab = "Latitude", ylab = "Longitude",
 main = "Surface elevation data",
 col.regions = terrain.colors(100),cuts=40,contour=T, plot.new=T, points=T)


contourplot(height~-x*-y, data = elevation.fit,
cuts = 20,labels = TRUE,col.regions = terrain.colors(100),
contour = TRUE, pretty = TRUE,region = T)

points(-70,-4,pch=20,col="blue") # aqui é onde não funciona