r - ggplot - change size of dots -


i plotting points on graph ggplot , geom_point. size of dots corresponds magnitude of data point. magnitude goes 2 10. draw dots applying factor of 0.5 magnitude sizes go 1 5. in legend, on side of graph, show real magnitude 2 10.

how can that?

there 2 possibilities:

1) divide magnitude 2:

geom_point(aes(size = magnitude/2)) 

2) use range = c(1,5) parameter:

geom_point(aes(size = magnitude)) + scale_size(range = c(1,5)) 

Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -