Whenever an ordinary legend is required, I find it preferable to draw the legend as a separate story, and then combine it.
For example, we can define the following function:
plot_legend <- function(dots, limits, title, bins = 20) { n <- 100 tiles <- data.frame(x = rep(0.5, n), y = seq(limits[1], limits[2], length.out = n)) ggplot() + geom_raster(data=tiles, aes(x = x, y = y, fill = y), interpolate = TRUE) + geom_dotplot(data = data.frame(x = dots), aes(x = -.05, y = x, fill = ..y..), stackdir = "down", binaxis = "y", binwidth = diff(limits)/bins, dotsize = .8) + scale_x_continuous(limits = c(-5, 1), expand = c(0, 0)) + scale_y_continuous(expand = c(0, 0), position = "right") + ggtitle(title) + theme_cowplot(12) + theme(axis.text.x = element_blank(), axis.ticks.x = element_blank(), axis.line = element_blank(), axis.title = element_blank(), plot.title = element_text(face = "plain", hjust = 1), legend.position = "none") }
What we can use like this:
require(ggplot2) require(cowplot) require(viridis) dots <- 3*runif(100) range <- c(0, 3) plot_legend(dots, range, "random numbers") + scale_fill_viridis()

Now we use this together with the card code. This requires a bit of tinkering with the final placement of legends in the drawings, but it is not too difficult.
require(dplyr) load(url("https://ikashnitsky.imtqy.com/misc/160227-SO-question/fortIT.RData"))

Two comments:
The size of the summed points can be controlled by the bins
argument of the plot_legend()
function. The more bins
, the less points.
I usually deleted the borders around each map, but I tried here to reproduce the original shape as close as possible.