CorrPatterns <- function(ano, lon, lat, PCs, nPCs = 4, nrow = NULL, ncol = NULL, show = FALSE, var = NULL){
  nlat <- length(lat)
  nlon <- length(lon)

  proj.cor <- array(NA, c(nPCs, nlat, nlon))

  ## Project the PCS:
  for(t in 1:nPCs) {
    proj.cor[t, , ] <- apply(ano, c(2,3), 
      function(x) {
        cor(x, PCs[,t], use = "na.or.complete")
      }
    )
  }

  if (show) {
    brks.corr <- seq(-1, 1, 0.1)
    
    ## plot title:
    if(is.null(var)) plot.titles <- paste0("EOF #", 1:nPCs) else plot.titles <- paste0("EOF #", 1:nPCs, "  (", round(var[1:nPCs],1), "% tot.var)")
    
    PlotLayout(PlotEquiMap, c(2,3), var=proj.cor, lat=lat, lon=lon, 
               filled.continents=FALSE, bar_scale=.5, brks=brks.corr, 
               nrow=nrow, ncol=ncol, titles=plot.titles)
    invisible(proj.cor)
  } else {
    proj.cor
  }
}
