I find a combined legend that the shape and type of a line is more difficult to decipher. in particular, the shape is hard to see because it is beyond the line and it is too small.
library(ggplot2)
ggplot(mtcars)+
geom_point(aes(x=hp,y=mpg,shape=as.factor(cyl)))+
geom_smooth(aes(x=hp,y=mpg,linetype=as.factor(cyl)),method='lm')+
theme_bw(base_size=18)
How to increase the size of figures in a legend without increasing the size of the line?
this attempt below increases the size for both (not what i want). the order guide_legendalso does not affect the order of characters in the symbol keys. Reordering geom_point and geom_smooth will give the desired result in the legend, but not on the chart.
+guides(linetype=guide_legend('Cylinders'),shape=guide_legend('Cylinders',override.aes=list(size=3)))
I also hoped to theme(legend.key.size=grid::unit(2,'cm'))increase the size of the objects in the legend key, but it doesn't seem to.
offers? also open to other ideas on how to make the schedule more understandable.