Is there currently an easy way to make a colourbar legend the same height as the plot area. e.g. something like this:
p <-ggplot2(some_plot_needing_a_colourbar_legend)+
guide=guide_colourbar()
p <- p + theme(legend.key.height=plot.height(p))
At the moment I only see a way to set the height using an array of units (using the unit()
function), including the height of the viewport, but not the height of the plot area. Also this function seems to specify height in absolute terms rather than relative. Am I missing something or is this not (at present) possible?