Question: Rgraphviz multiline edge label
0
gravatar for Guest User
5.8 years ago by
Guest User12k
Guest User12k wrote:
Hello, I am plotting a graph using Rgraphviz and I would like some long edge labels to be written in more than one line. However, when using \n to insert newline character, only the first line is displayed as edge label. In this example code: library("graph") library("Rgraphviz") g<-new("graphNEL", nodes=c("node1","node2"), edgemode="directed") g <- addEdge("node1","node2",g) eAttrs <- list() eAttrs$label=c("node1~node2"="First\nlong\nlabel") plot(g, edgeAttrs=eAttrs) The edge label plotted is just "First". Does anyone has a clue on how to plot multiline edge labels with Rgraphviz? Thank you -- output of sessionInfo(): > sessionInfo() R version 2.15.1 (2012-06-22) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US LC_NUMERIC=C LC_TIME=en_US [4] LC_COLLATE=en_US LC_MONETARY=en_US LC_MESSAGES=en_US [7] LC_PAPER=C LC_NAME=C LC_ADDRESS=C [10] LC_TELEPHONE=C LC_MEASUREMENT=en_US LC_IDENTIFICATION=C attached base packages: [1] grid stats graphics grDevices utils datasets methods [8] base other attached packages: [1] Rgraphviz_2.2.1 graph_1.36.2 loaded via a namespace (and not attached): [1] BiocGenerics_0.4.0 stats4_2.15.1 tools_2.15.1 -- Sent via the guest posting facility at bioconductor.org.
graph rgraphviz • 817 views
ADD COMMENTlink modified 5.8 years ago by Vincent J. Carey, Jr.6.3k • written 5.8 years ago by Guest User12k
Answer: Rgraphviz multiline edge label
0
gravatar for Vincent J. Carey, Jr.
5.8 years ago by
United States
Vincent J. Carey, Jr.6.3k wrote:
thanks for the reproducible example use sufficient backslashing eAttrs$label=c("node1~node2"="First\\\nlong\\\nlabel") On Wed, Jul 17, 2013 at 5:22 AM, Ludovica Montanucci [guest] < guest@bioconductor.org> wrote: > > Hello, > I am plotting a graph using Rgraphviz and I would like some long edge > labels to be written in more than one line. > However, when using \n to insert newline character, only the first line is > displayed as edge label. > In this example code: > > library("graph") > library("Rgraphviz") > g<-new("graphNEL", nodes=c("node1","node2"), edgemode="directed") > g <- addEdge("node1","node2",g) > eAttrs <- list() > eAttrs$label=c("node1~node2"="First\nlong\nlabel") > plot(g, edgeAttrs=eAttrs) > > The edge label plotted is just "First". > Does anyone has a clue on how to plot multiline edge labels with Rgraphviz? > Thank you > > > -- output of sessionInfo(): > > > sessionInfo() > R version 2.15.1 (2012-06-22) > Platform: x86_64-pc-linux-gnu (64-bit) > > locale: > [1] LC_CTYPE=en_US LC_NUMERIC=C LC_TIME=en_US > [4] LC_COLLATE=en_US LC_MONETARY=en_US LC_MESSAGES=en_US > [7] LC_PAPER=C LC_NAME=C LC_ADDRESS=C > [10] LC_TELEPHONE=C LC_MEASUREMENT=en_US LC_IDENTIFICATION=C > > attached base packages: > [1] grid stats graphics grDevices utils datasets methods > [8] base > > other attached packages: > [1] Rgraphviz_2.2.1 graph_1.36.2 > > loaded via a namespace (and not attached): > [1] BiocGenerics_0.4.0 stats4_2.15.1 tools_2.15.1 > > -- > Sent via the guest posting facility at bioconductor.org. > > _______________________________________________ > 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 COMMENTlink written 5.8 years ago by Vincent J. Carey, Jr.6.3k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 153 users visited in the last hour