I am trying to create a plot of precipitation with points where the precipitation is over a certain threshold. I have a data called tp98slice with values 0 or 1 on a 61x101 grid. I want to plot these as points if the value is equal to 1 at each grid point.
I have tried the following code,
levelplot(tpslice ~ lon * lat, data=grid, at=cutpts, cuts=50, pretty=T,
col.regions=(brewer.pal(9,"Blues")),
xlab="Longitude", ylab="Lattitude") +
layer(sp.points(tp98_pts, pch=ifelse(tp98slice==1, 1, 4), cex=2))
But the layer bit (my points) is not working/showing up.
Current plot
No comments:
Post a Comment