I have a ggplot with two legends, one for point colour and one for linetype.
I would like to extend the width of only the linetype legend key.
I can set the overall legend.key.width
with theme(legend.key.width = unit(5, "cm"))
, but this increases the width for both legends. Is there a way to set the width for just one of the legends?
Example
iris$Group <- as.factor(rep(1:3, 50))
ggplot(iris, aes(Sepal.Length, Sepal.Width)) +
geom_point(aes(colour = Species)) +
geom_line(aes(linetype = Group))