r - "guides", "colourbar" and "keyheight" in ggplot2 -
using ggplot2 made barplot in each bars filled gradient. problem concerns legend of plot. bar filled same colour gradient:
scale_fill_gradient( low = "lightpurple", high = "black", limits = c(0, max(graph$y)), "colourbar")
when wanted change height of legend bar tried instead:
scale_fill_gradient( low = "lightpurple", high = "black", limits = c(0, max(graph$y)), guides("colourbar", guide_legend(keyheight = 2))
but nothing changed. , when precise height of bar without colour gradient, height correct.
scale_fill_gradient( low = "lightpurple", high = "black", limits = c(0, max(graph$y)), guide = guide_legend(keyheight = 2))
what did wrong when mentioning both "colourbar" , "height" in "guides"?
Comments
Post a Comment