[BioC] How to use the same node layout for a set of graph plots using graph and Rgraphviz?
rand at amgen.com
Wed Jan 30 22:07:09 CET 2008
Thanks for the work-around. I will post an example when I get a nice example sorted out. Sorry about not running sessionInfo to provide version info.
From: Robert Gentleman [mailto:rgentlem at fhcrc.org]
Sent: Tuesday, January 29, 2008 9:22 AM
To: Rand, Hugh
Cc: bioconductor at stat.math.ethz.ch
Subject: Re: [BioC] How to use the same node layout for a set of graph plots using graph and Rgraphviz?
Sorry to say not easily. And sorry for the long delay in responding,
I was trying a few things out, but solving this problem seems to require
a bit of redesign.
The only thing that might work, in a fairly straightforward fashion
is, something like this:
V = letters[1:7];
M = c(1:3);
g1 = randomGraph(V,M,.5);
g2 = randomGraph(V,M,.5);
g3 = union(g1, g2)
then layout g3, make a copy of it, set the edge color for g1 edges in
one copy to the background and for g2 in the other copy.
You did not say which version of Rgraphviz you are using, but there
have been a lot of changes to the devel version to make setting node and
edge attributes for rendering simpler.
Rand, Hugh wrote:
> I am using the packages "graph" and "Rgraphviz". I am using them to display a
> set of graphs which all have the same nodes, but different edges. To aid in the
> visual comparison, it would be useful to use the same node layout for all of
> the graphs. It would be fine to use the node layout from the first graph. It is
> unclear (to me) how to do this using the layout engine used in Rgraphviz.
> A concrete example:
> V = letters[1:7];
> M = c(1:3);
> g1 = randomGraph(V,M,.5);
> g2 = randomGraph(V,M,.5);
> # The question: How do I now display both g1 and g2 (as seperate plots),
> # but with the nodes in the same place? I would be content with the node
> # locations taken from the layout for g1.
> Hugh Rand
> rand at amgen.com
> [[alternative HTML version deleted]]
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
Robert Gentleman, PhD
Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
PO Box 19024
Seattle, Washington 98109-1024
rgentlem at fhcrc.org
More information about the Bioconductor