I have this graph created by the geom_bar () function:
Iwouldliketoseparatethetwoboxeswheretheyareplottedtofill,asfollows:
How do I do this? which parameter of the theme () function can I use to solve this problem?
The legend.key.size attribute changes the distance between the elements a little. See if it suits you:
legend.key.size
library(ggplot2) ggplot(iris, aes(x = Sepal.Length, y = Petal.Length, color = Species)) + geom_point() + theme( legend.key.size = unit(3, 'lines') )
Here the reference in English.