I cannot scale a legend when using the draw_plot function.
df = data.frame(x=c(1,2,3), y=c(1,2,3), pval=c(0.01, 0.1, 1))
gg = ggplot(df, aes(x=x, y=y, color=pval))+geom_point()
leg = get_legend(gg)
gg + theme(legend.position = "none") +
draw_plot(leg, x=2.9, y=2.2, width=0.1, height=0.2, scale=0.1)
I played around with the width, height and scale arguments and came to the following conclusion: width and height shifts the legend (add values to to x,y coordinates), whereas scale does nothing.
What am I missing?