[BioC] More advance node labeling in Graphviz
huber at ebi.ac.uk
Fri Nov 12 15:21:47 CET 2004
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",
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.
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,
European Bioinformatics Institute
European Molecular Biology Laboratory
Wellcome Trust Genome Campus
Cambridge CB10 1SD
Phone: +44 1223 494642
More information about the Bioconductor