new hexbin + adding points to hexbin plots
2
0
Entering edit mode
Naomi Altman ★ 6.0k
@naomi-altman-380
Last seen 3.7 years ago
United States
When I download hexbin from Bioconductor and then use library(hexbin) I get the message that I should download the newest version. The old version is fine for what I want to do, except that I would like to add some points to the plot. e.g. an MA plot with controls highlighted plot(MA$A[,1],MA$M[,1],main="MA plot") points(MA$A[mypoints,1],MA$M[mypoints,1],col=2) I want to replace the first plot command with hexbin (so I can actually visualize the dense region of the plot), but I want to be able to add my points to the plot. plot(hexbin(MA$A[,1],MA$M[,1]),main="MA plot") points(MA$A[mypoints,1],MA$M[mypoints,1],col=2) does not give an error message. But the points do not show up. If the new version can do this, could someone please point me to the download site. Thanks, Naomi S. Altman 814-865-3791 (voice) Associate Professor Bioinformatics Consulting Center Dept. of Statistics 814-863-7114 (fax) Penn State University 814-865-1348 (Statistics) University Park, PA 16802-2111
hexbin hexbin • 2.1k views
ADD COMMENT
0
Entering edit mode
@ariel-chernomoretz-885
Last seen 10.3 years ago
Hi Naomi, You could try something like this, hbin<-hexbin(xx,yy,xbins=50) #hexbin plot pp<-plot(hbin,legend=FALSE) pushHexport(pp$plot.vp) x<-seq(4,13,length=100) #points you want to add y<-mysigma.rma.bio1(x) #to the hexbin plot grid.points(x,y,gp=gpar(col=2),pch=20) popViewport() Regards, Ariel./ On July 18, 2005 01:16 pm, Naomi Altman wrote: > When I download hexbin from Bioconductor and then use library(hexbin) I get > the message that I should download the newest version. > > The old version is fine for what I want to do, except that I would like to > add some points to the plot. > > e.g. an MA plot with controls highlighted > > plot(MA$A[,1],MA$M[,1],main="MA plot") > points(MA$A[mypoints,1],MA$M[mypoints,1],col=2) > > I want to replace the first plot command with hexbin (so I can actually > visualize the dense region of the plot), but I want to be able to add my > points to the plot. > > > plot(hexbin(MA$A[,1],MA$M[,1]),main="MA plot") > points(MA$A[mypoints,1],MA$M[mypoints,1],col=2) > > does not give an error message. But the points do not show up. > > If the new version can do this, could someone please point me to the > download site. > > Thanks, > > > Naomi S. Altman 814-865-3791 (voice) > Associate Professor > Bioinformatics Consulting Center > Dept. of Statistics 814-863-7114 (fax) > Penn State University 814-865-1348 (Statistics) > University Park, PA 16802-2111 > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor -- Ariel Chernomoretz, Ph.D. Centre de recherche du CHUL 2705 Blv Laurier, bloc T-367 Sainte-Foy, Qc G1V 4G2 (418)-525-4444 ext 46339
ADD COMMENT
0
Entering edit mode
Thanks Ariel, I was not able to find pushHexport and it does not appear using help.search. --Naomi At 01:27 PM 7/18/2005, Ariel Chernomoretz wrote: >Hi Naomi, > >You could try something like this, > > hbin<-hexbin(xx,yy,xbins=50) #hexbin plot > pp<-plot(hbin,legend=FALSE) > > > pushHexport(pp$plot.vp) > x<-seq(4,13,length=100) #points you want > to add > y<-mysigma.rma.bio1(x) #to the hexbin plot > grid.points(x,y,gp=gpar(col=2),pch=20) > popViewport() > >Regards, >Ariel./ > > > >On July 18, 2005 01:16 pm, Naomi Altman wrote: > > When I download hexbin from Bioconductor and then use library(hexbin) I get > > the message that I should download the newest version. > > > > The old version is fine for what I want to do, except that I would like to > > add some points to the plot. > > > > e.g. an MA plot with controls highlighted > > > > plot(MA$A[,1],MA$M[,1],main="MA plot") > > points(MA$A[mypoints,1],MA$M[mypoints,1],col=2) > > > > I want to replace the first plot command with hexbin (so I can actually > > visualize the dense region of the plot), but I want to be able to add my > > points to the plot. > > > > > > plot(hexbin(MA$A[,1],MA$M[,1]),main="MA plot") > > points(MA$A[mypoints,1],MA$M[mypoints,1],col=2) > > > > does not give an error message. But the points do not show up. > > > > If the new version can do this, could someone please point me to the > > download site. > > > > Thanks, > > > > > > Naomi S. Altman 814-865-3791 (voice) > > Associate Professor > > Bioinformatics Consulting Center > > Dept. of Statistics 814-863-7114 (fax) > > Penn State University 814-865-1348 (Statistics) > > University Park, PA 16802-2111 > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor at stat.math.ethz.ch > > https://stat.ethz.ch/mailman/listinfo/bioconductor > >-- >Ariel Chernomoretz, Ph.D. >Centre de recherche du CHUL >2705 Blv Laurier, bloc T-367 >Sainte-Foy, Qc >G1V 4G2 >(418)-525-4444 ext 46339 > >_______________________________________________ >Bioconductor mailing list >Bioconductor at stat.math.ethz.ch >https://stat.ethz.ch/mailman/listinfo/bioconductor Naomi S. Altman 814-865-3791 (voice) Associate Professor Bioinformatics Consulting Center Dept. of Statistics 814-863-7114 (fax) Penn State University 814-865-1348 (Statistics) University Park, PA 16802-2111
ADD REPLY
0
Entering edit mode
Hi Naomi, pushHexport is included in new versions of hexbin package (for instance in hexbin 1.3.0 from the development branch) I am not an expert using grid but I think once you make the hexbin plot the current viewport (using pushHexport) you can use any function of the grid package on it (i.e. grid.points, grid.text, etc) A./ On July 18, 2005 01:38 pm, Naomi Altman wrote: > Thanks Ariel, > > I was not able to find > > pushHexport > > and it does not appear using help.search. > > --Naomi > > At 01:27 PM 7/18/2005, Ariel Chernomoretz wrote: > >Hi Naomi, > > > >You could try something like this, > > > > hbin<-hexbin(xx,yy,xbins=50) #hexbin plot > > pp<-plot(hbin,legend=FALSE) > > > > > > pushHexport(pp$plot.vp) > > x<-seq(4,13,length=100) #points you want > > to add > > y<-mysigma.rma.bio1(x) #to the hexbin plot > > grid.points(x,y,gp=gpar(col=2),pch=20) > > popViewport() > > > >Regards, > >Ariel./ > > > >On July 18, 2005 01:16 pm, Naomi Altman wrote: > > > When I download hexbin from Bioconductor and then use library(hexbin) I > > > get the message that I should download the newest version. > > > > > > The old version is fine for what I want to do, except that I would like > > > to add some points to the plot. > > > > > > e.g. an MA plot with controls highlighted > > > > > > plot(MA$A[,1],MA$M[,1],main="MA plot") > > > points(MA$A[mypoints,1],MA$M[mypoints,1],col=2) > > > > > > I want to replace the first plot command with hexbin (so I can actually > > > visualize the dense region of the plot), but I want to be able to add > > > my points to the plot. > > > > > > > > > plot(hexbin(MA$A[,1],MA$M[,1]),main="MA plot") > > > points(MA$A[mypoints,1],MA$M[mypoints,1],col=2) > > > > > > does not give an error message. But the points do not show up. > > > > > > If the new version can do this, could someone please point me to the > > > download site. > > > > > > Thanks, > > > > > > > > > Naomi S. Altman 814-865-3791 (voice) > > > Associate Professor > > > Bioinformatics Consulting Center > > > Dept. of Statistics 814-863-7114 (fax) > > > Penn State University 814-865-1348 (Statistics) > > > University Park, PA 16802-2111 > > > > > > _______________________________________________ > > > Bioconductor mailing list > > > Bioconductor at stat.math.ethz.ch > > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > > >-- > >Ariel Chernomoretz, Ph.D. > >Centre de recherche du CHUL > >2705 Blv Laurier, bloc T-367 > >Sainte-Foy, Qc > >G1V 4G2 > >(418)-525-4444 ext 46339 > > > >_______________________________________________ > >Bioconductor mailing list > >Bioconductor at stat.math.ethz.ch > >https://stat.ethz.ch/mailman/listinfo/bioconductor > > Naomi S. Altman 814-865-3791 (voice) > Associate Professor > Bioinformatics Consulting Center > Dept. of Statistics 814-863-7114 (fax) > Penn State University 814-865-1348 (Statistics) > University Park, PA 16802-2111 > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor -- Ariel Chernomoretz, Ph.D. Centre de recherche du CHUL 2705 Blv Laurier, bloc T-367 Sainte-Foy, Qc G1V 4G2 (418)-525-4444 ext 46339
ADD REPLY
0
Entering edit mode
@nicholas-lewin-koh-63
Last seen 10.3 years ago
Hi, Haven't been checking the list for a while. what I think you want to do is look at the function plotMAhex in the new hexbin package. if that doesn't work for you you can try: hbp<-plot(hexbin(MA$A[,1],MA$M[,1]),main="MA plot") pushHexport(hbp$plot) grid.points(MA$A[mypoints,1],MA$M[mypoints,1],col=2) Nicholas
ADD COMMENT
0
Entering edit mode
You might also be interested in the following thread https://stat.ethz.ch/pipermail/r-help/2005-April/067174.html Regards, Adai On Mon, 2005-07-25 at 12:20 -0500, Nicholas Lewin-Koh wrote: > Hi, > Haven't been checking the list for a while. > what I think you want to do is look at the function plotMAhex in the new > hexbin package. > if that doesn't work for you you can try: > > hbp<-plot(hexbin(MA$A[,1],MA$M[,1]),main="MA plot") > pushHexport(hbp$plot) > grid.points(MA$A[mypoints,1],MA$M[mypoints,1],col=2) > > Nicholas > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor >
ADD REPLY

Login before adding your answer.

Traffic: 483 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6