I have a raster that I'd like to plot in the Azimuthal Equidistant projection with a grid and labels. So far I've been able to do that. However, I cannot get the labels inside the plotting area. They are always cut off.
I have tried most of the par() options such as playing with par(mar), par(oma), and par(usr). Hard to tell, but I think the par("usr") option does not work with raster::plot. I also tried playing around with the extent of the raster, since R bases the plot size on the coordinate range of the initial data, but that also did not work. Below is my code and cut off labels.
GSmean<-stack("[file]") parallels <- c(80, 70, 60) meridians <- seq(-180, 160, by = 30) mlim <- c(-180, 180) plim <- c(50, 80) grat <- graticule(lons = meridians, lats = parallels, xlim = mlim, ylim = plim, proj = projection(GSmean)) labs <- graticule_labels(meridians, parallels, xline = 360, yline =46, proj = projection(GSmean)) #new plot breaks<-c(-1,0,1,2,999) cols <- c("darkgreen", "darkred","gray81","gray81") plot(GSmean, col=cols,breaks=breaks,axes=F,legend=FALSE,box=FALSE) plot(grat, add = TRUE, lty = 3,col="honeydew3") text(labs, lab = parse(text= labs$lab), col= c("gray30", "gray30")[labs$islon + 1], cex = 0.85)