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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -