Using PlotLayout() with CSTools::PlotMostLikelyQuantileMap()
Hi @aho
In the end I cannot reproduce the results I'm getting with my Auto-S2S code so I'm just going to start here. Hopefully we'll get there eventually.
I was trying to use PlotLayout() to create multiple Most Likely Tercile plots:
library(abind)
library(CSTools)
library(s2dv)
x <- array(1:(20 * 10 * 3), dim = c(lat = 10, lon = 20, time = 3)) / 200
a <- x * 0.6
b <- (1 - x) * 0.6
c <- 1 - (a + b)
lons <- seq(0, 359.5, length = 20)
lats <- seq(-89.5, 89.5, length = 10)
probs <- abind(a, b, c, along = 0)
dim(probs) <- c("bin" = 3, dim(a))
# Single plot:
PlotMostLikelyQuantileMap(probs[, , , 1], lons, lats,
toptitle = 'Most likely tercile map',
bar_titles = paste('% of belonging to', c('a', 'b', 'c')),
brks = 20, width = 10, height = 8)
# Layout of three plots (one per instance of the 'time' dimension), Fails.
PlotLayout(PlotMostLikelyQuantileMap, c('bin', 'lon', 'lat'),
probs, lons, lats,
toptitle = 'Most likely tercile map',
titles = c("First", "Second", "Third"),
bar_titles = paste('% of belonging to', c('a', 'b', 'c'),
brks = 20, width = 10, height = 8))
# Error in if (length(lat) != dim(maps)[lat_dim]) { :
# missing value where TRUE/FALSE needed
The error seems to come from this check in PlotCombinedMap() (which has a typo btw).
The weird thing is, I'm not getting this error in the Verification tool (you can see my code here), but PlotLayout() is still not working as it should (it only displays one plot).
Any help is appreciated,
Victòria