[R] linewidth in Rgraphviz

Ben Bolker bolker at ufl.edu
Mon Oct 8 17:14:50 CEST 2007




Robert Gentleman wrote:
> 
> Hi Ben,
>    Sorry for the slow reply, but something like this works,
> 
>   [...]
> 


  Sorry not to have responded sooner.  I had actually
worked it out for myself (after finding another e-mail
exchange on the Bioconductor list that indicated the
problem had been solved).

 This is a fragment of a larger piece of code, 
but here's what I did to make the line widths
proportional to sqrt(edge weight):

en = edgeNames(gr2)
lw = sqrt(unlist(edgeWeights(gr2)))
en2 = gsub("~",".",en)
lw2 = lw[en2]

names(lw2) = en
eAttrs <- list(lwd=lw2)
## sublists and node attributes defined earlier ...
plot(gr2,subGList=sglist2,nodeAttrs=nAttrs,edgeAttrs=eAttrs,"neato")

    thanks for such useful tools!

 sincerely
    Ben Bolker

-- 
View this message in context: http://www.nabble.com/linewidth-in-Rgraphviz-tf4565412.html#a13098418
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list