Rgraphviz multiline edge label
1
0
Entering edit mode
Guest User ★ 13k
@guest-user-4897
Last seen 10.2 years ago
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 graph Rgraphviz • 1.7k views
ADD COMMENT
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 8 weeks ago
United States
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 COMMENT

Login before adding your answer.

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