1

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

Laura Owen
  • 11
  • 1
  • Laura, the chances of getting a helpful answer increase if you provide specific information. [This post](https://stackoverflow.com/a/56747472/3508856) provides really good advice. Good luck! – David O Jul 20 '19 at 17:07

0 Answers0