Is there a way to ensure that the legend for the size aesthetic in ggplot always starts and finishes at the minimum and maximum values?
For instance, the minimum value in the call below:
p<-ggplot(mpg, aes(displ, hwy, size = hwy)) + geom_point()
(first example here) should be 12. But the smallest circle size it shows corresponds to a value of 20.
I tried adding:
p+scale_size_manual(values=c(min(mpg$hwy),median(mpg$hwy), max(mpg$hwy)), labels = c(as.character(min(mpg$hwy)),as.character(median(mpg$hwy)), as.character(max(mpg$hwy))))
but it throws an error (even though I think the labels and values are in the appropriate format). I also tried:
scale_size_continuous(range = c(min(mpg$hwy), max(mpg$hwy))
as recommended here, but it makes symbols which are WAY too big.
Any clues? thanks!