More advance node labeling in Graphviz
2
0
Entering edit mode
Adrian Alexa ▴ 400
@adrian-alexa-936
Last seen 9.6 years ago
Dear Bioconductor developers, I'm using Rgraphviz packages for plotting graphs. I would like to know if I can label nodes with information that can be displayed on more lines. Something like: ------------ | info1 | | info2 | | info3 | ------------ I looked at the drawTxtLabel() function and I try to give as label for the node: nodeLabel = 'info1 \n info2 \n info3' but it didn't work. Can somebody tell me if he managed to plot such labels, and if is possible some small code will be nice. Many thanks, Adrian -- Adrian Alexa Max-Planck-Institut fuer Informatik Stuhlsatzenhausweg 85 Room 514 66123 Saarbruecken, Germany
Rgraphviz Rgraphviz • 3.7k views
ADD COMMENT
0
Entering edit mode
@wolfgang-huber-3550
Last seen 10 days ago
EMBL European Molecular Biology Laborat…
Hi Adrian, 1. Have you tried escaping the \n multiple times, e.g. \\n, \\\\n? Without understanding the details, sometimes this works. 2. You could use the "text" command, e.g. nag = agopen( IMCAGraph, name="nag", attrs= list(node=list(color="white", fontcolor="white"), edge=list(arrowsize=2.8, minlen=3))) nagxy = getNodeXY( nag ) plot( nag ) text( nagxy, label=nodes(IMCAGraph), cex=.8) with that your approach of including \n should work. This code example is due to Vince Carey. A potential problem may be that the arrows might overlap with the labels. 3. As an alternative, consider the imageMap function in Rgraphviz, with which you can associate tooltips and hyperlinks to (bitmap versions of) your graph visualizations. Best wishes Wolfgang Adrian Alexa wrote: > Dear Bioconductor developers, > > > I'm using Rgraphviz packages for plotting graphs. > > I would like to know if I can label nodes with information that can be > displayed on more lines. Something like: > > ------------ > | info1 | > | info2 | > | info3 | > ------------ > > > I looked at the drawTxtLabel() function and I try to give as label for > the node: > > nodeLabel = 'info1 \n info2 \n info3' > > but it didn't work. > > Can somebody tell me if he managed to plot such labels, and if is > possible some small code will be nice. > > > > Many thanks, > > Adrian > > -- Best wishes Wolfgang ------------------------------------- Wolfgang Huber European Bioinformatics Institute European Molecular Biology Laboratory Wellcome Trust Genome Campus Cambridge CB10 1SD England Phone: +44 1223 494642 Http: www.dkfz.de/abt0840/whuber
ADD COMMENT
0
Entering edit mode
@wolfgang-huber-3550
Last seen 10 days ago
EMBL European Molecular Biology Laborat…
Sean Davis wrote: > Wolfgang, > > Thanks for the example code. Could I impose on you to expound a bit on > (3)? > Have you seen the manual page for imageMap in package Rgraphviz? Let me know if it leaves any open questions. -- Best wishes Wolfgang ------------------------------------- Wolfgang Huber European Bioinformatics Institute European Molecular Biology Laboratory Wellcome Trust Genome Campus Cambridge CB10 1SD England Phone: +44 1223 494642 Http: www.dkfz.de/abt0840/whuber
ADD COMMENT

Login before adding your answer.

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