user3089803
user3089803

Reputation: 109

adding values to ggplot legend

p<-ggplot(d,aes(Method, Prevalence, size=N))
p+geom_point()+ylab("% Prevalence Rate")+ labs(size = "# of Cases")

When creating this scatter-plot that has been weighted by N (continuous variable ranges from 0-300), I get a legend that displays the markers for N values 100, 200, 300 only. How do I add other values to this legend? Say add N=50 marker for this legend?

Upvotes: 0

Views: 163

Answers (1)

yosukesabai
yosukesabai

Reputation: 6244

http://www.inside-r.org/packages/cran/ggplot2/docs/scale_area p+scale_size_continuous(breaks=seq(0,300,by=50))

Upvotes: 2

Related Questions