简体   繁体   中英

Manipulating baseline size of a geom_point in R w/ ggplot2

I have a data set I'm trying to build a scatter plot from in R.

On the Y axis I've got CTR, on the x-axis I've got CPM and I'm trying to scale the size of each point by the volume of impressions.

I'm able to successfully plot this but the baseline size of the points is quite small and I'd like to specify a specific baseline size to use and then scale up from there based off the Volume data.

Here is my current code:

data_set <- ggplot(mopub_pubs_2, aes(x=CPM, y=CTR))
data_set + geom_point(aes(size=Volume))

I've looked through the ggplot documentation but can't find anything that might allow me to manipulate size of points this way. Is anyone aware of a way to do this?

You can use function scale_size_continuous() to change size of your points. Default range= for points is form 1 to 6 and your Volume values are scaled in this range but you can change it to some larger values, for example, from 5 to 12.

+ scale_size_continuous(range=c(5,12))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM