Hello, everyone, I have following csv-file(simplified) as instance:


0.29,2,50
0.32,3,10
0.28,4,71
0.27,1,62
0.53,1,33
0.83,5,100

with the first column for x-axis (proportion shared), the second for y-axis (number of shared segments), the shades for 'number of pairs'.


I wonder how to realize that the "number of pairs" are denoted by different shades as shown in the attachment ? So far, I can plot a histogram by these codes, but have no idea how to correctly add information of shades to it.

df<-read.csv(file="c-all-prop-test.csv",head=F,sep=",")
require(ggplot2)
qplot(x=df[,1],weight=df[,2],geom="histogram",xlab="proportion shared",ylab="number of shared segments",colour = I("darkgreen"), fill = I("blue"))

It seems that d + stat_bin2d() may help. Or maybe heatmap?

Could you give me some suggestions? Best regards

<<attachment: R.png>>

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to