ggplot2 - ggplot - Change legend title and increase keysize - ggplot2 tutorial - ggplot tutorial
# load the library
library(ggplot2)
# create a blank canvas
g <- ggplot(data = diamonds)
g + geom_bar(aes(x = cut, fill = cut)) +
scale_fill_discrete(guide = guide_legend(title = "CUT",
keywidth = 2,
keyheight = 2))
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy - ggplot2 tutorial - ggplot tutorial - ggplot2 - ggplot - learn ggplot2 - ggplot2 examples - team
![](https://wikitechy.com/tutorials/ggplot2/img/ggplot2-images/cRPmB-ggplot2.jpg)
Learn ggplot2 - ggplot2 tutorial - Cut Per Count Module - ggplot2 examples - ggplot2 programs