I generate the legend in my ggplot2 plot with
scale_colour_discrete(name=textCF)
I like that i can see which colour belongs to which value, but it consumes to much space in the plot.

I tried also the scale_colour_gradientn scheme, but this is so condensed, that i can not distiguish the values anymore. If i could only change the width of this colourbar.
scale_colour_gradientn(name=textCF,colours = rainbow(nrow(mydf), start=2/6), breaks=round(mydf$CF)) +

How can I improve the lookout?
The size of a colourbar can be controlled with the
barwidthandbarheightparameters.Start with a reproducible example to see the effects:
I’m using
scale_colour_gradient, but this works in general.You control aspects of the guide with the
guideargument to a scale. See the help onguide_colourbarfor all the parameters that you can set.