node-edge connection
1
0
Entering edit mode
Chris Knight ▴ 10
@chris-knight-4476
Last seen 10.2 years ago
Dear all, I'm trying to plot star-shaped graphs via Rgraphviz (see example below). However, having adjusted node and label sizes to make things legible (the default has undue overlap), the ends of the edges go nowhere near the nodes, making interpretation difficult (they look as though they're going to the edge of the default sized node). I suspect I'm missing something fundamental about the 'actual' size of the nodes versus the size of their polygons, but have so far been unable to figure it out. 'headclip=FALSE' I might have expected to sort this out, but that is unimplemented and doesn't tackle the real problem In the example below I've included several of the other edge attributes I'm setting, in case there are any interactions there. apologies if I've missed something obvious (either in the approach or the archive) any help gratefully received, Chris testNet<-ftM2graphNEL(cbind(rep("centre",100),paste("outer",1:100)), edgemode="directed") cols<-rainbow(100) wdth<-runif(100,min=0,max=10) heads<-sample(c("open","none","tee"),100,replace=TRUE) tails<-sample(c("open","none","tee"),100,replace=TRUE) names(cols) <- names(wdth) <- names(heads) <- names(tails) <- paste(rep("centre",100),paste("outer",1:100),sep="~") testNetL<-layoutGraph(testNet, layoutType="neato") edgeRenderInfo(testNetL)<-list(col=cols, arrowhead=heads, arrowtail=tails,dir="both", lwd=wdth, headclip=hclip, tailclip=tclip) nodeRenderInfo(testNetL) <- list(cex=0.7,width=20, height=20) renderGraph(testNetL) sessionInfo() R version 2.12.1 (2010-12-16) Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) locale: [1] en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8 attached base packages: [1] grid stats graphics grDevices utils datasets methods [8] base other attached packages: [1] Rgraphviz_1.28.0 graph_1.28.0 loaded via a namespace (and not attached): [1] tools_2.12.1 > I hope it doesn't come down to this (which hasn't caused obvious problems beforeĀ– this was the available version for download): Warning message: In fun(...) : Rgraphviz built with Graphviz version 2.24.0. Found installed Graphviz version 2.26.3. This _may_ cause problems. [[alternative HTML version deleted]]
Rgraphviz Rgraphviz • 1.2k views
ADD COMMENT
0
Entering edit mode
@nishant-gopalakrishnan-3253
Last seen 10.2 years ago
Hi Chris, I tried some of the different options for the layoutType argument for the layoutGraph function in your graph example and was able to get something that was more reasonable to interpret. Perhaps you could try out this code testNet<-ftM2graphNEL(cbind(rep("centre",100),paste("outer",1:100)), edgemode="directed") cols<-rainbow(100) wdth<-runif(100,min=0,max=4) heads<-sample(c("open","none","tee"),100,replace=TRUE) tails<-sample(c("open","none","tee"),100,replace=TRUE) names(cols) <- names(wdth) <- names(heads) <- names(tails) <- paste(rep("centre",100),paste("outer",1:100),sep="~") testNetL<-layoutGraph(testNet, layoutType="fdp") edgeRenderInfo(testNetL)<-list(col=cols, arrowhead=heads, arrowtail=tails, dir="both", lwd=wdth) nodeRenderInfo(testNetL) <- list(cex=0.7,width=20, height=20) renderGraph(testNetL) Another option layoutType = "circo" gives you a circular layout . Nishant On 02/08/2011 04:55 AM, Chris Knight wrote: > Dear all, > > I'm trying to plot star-shaped graphs via Rgraphviz (see example below). However, having adjusted node and label sizes to make things legible (the default has undue overlap), the ends of the edges go nowhere near the nodes, making interpretation difficult (they look as though they're going to the edge of the default sized node). > > I suspect I'm missing something fundamental about the 'actual' size of the nodes versus the size of their polygons, but have so far been unable to figure it out. > > 'headclip=FALSE' I might have expected to sort this out, but that is unimplemented and doesn't tackle the real problem > > In the example below I've included several of the other edge attributes I'm setting, in case there are any interactions there. > > apologies if I've missed something obvious (either in the approach or the archive) > > any help gratefully received, > > Chris > > testNet<-ftM2graphNEL(cbind(rep("centre",100),paste("outer",1:100)), edgemode="directed") > cols<-rainbow(100) > wdth<-runif(100,min=0,max=10) > heads<-sample(c("open","none","tee"),100,replace=TRUE) > tails<-sample(c("open","none","tee"),100,replace=TRUE) > names(cols) <- names(wdth) <- names(heads) <- names(tails) <- paste(rep("centre",100),paste("outer",1:100),sep="~") > testNetL<-layoutGraph(testNet, layoutType="neato") > edgeRenderInfo(testNetL)<-list(col=cols, arrowhead=heads, arrowtail=tails,dir="both", lwd=wdth, headclip=hclip, tailclip=tclip) > nodeRenderInfo(testNetL) <- list(cex=0.7,width=20, height=20) > renderGraph(testNetL) > > sessionInfo() > R version 2.12.1 (2010-12-16) > Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) > > locale: > [1] en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8 > > attached base packages: > [1] grid stats graphics grDevices utils datasets methods > [8] base > > other attached packages: > [1] Rgraphviz_1.28.0 graph_1.28.0 > > loaded via a namespace (and not attached): > [1] tools_2.12.1 > >> > I hope it doesn't come down to this (which hasn't caused obvious problems before-- this was the available version for download): > > Warning message: > In fun(...) : Rgraphviz built with Graphviz version 2.24.0. > Found installed Graphviz version 2.26.3. This _may_ cause problems. > > > [[alternative HTML version deleted]] > > > > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor [[alternative HTML version deleted]]
ADD COMMENT

Login before adding your answer.

Traffic: 833 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