r - How to modify ggplot2 scater plot -
here sample dataset:
df1 = data.frame(count.amp = c(8,8,1,2,2,5,8), count.amp.1 = c(4,4,2,3,2,5,4))
i tried
library(ggplot2) qplot(count.amp,count.amp.1, data=df1)
is there ways plot in such way size of dot proportional number of elements in each dots?
yes, broadly speaking looking @ creating bubble plot, code:
df1 = data.frame(count.amp = c(8,8,1,2,2,5,8), count.amp.1 = c(4,4,2,3,2,5,4)) df1$sum <- df1$count.amp + df1$count.amp.1 ggplot(df1, aes(x=count.amp, y=count.amp.1, size=sum),guide=false)+ geom_point(colour="white", fill="red", shape=21)+ scale_size_area(max_size = 15)+ theme_bw()
would give that: wasn't clear me yo mean number of elements on principle can pass figures size=
desired result.
Comments
Post a Comment