
plotGraphSpace
is a wrapper function to
create dedicated ggplot graphics for igraph- and GraphSpace-class objects.
# S4 method for GraphSpace
plotGraphSpace(
gs,
xlab = "Graph coordinates 1",
ylab = "Graph coordinates 2",
font.size = 1,
theme = c("th1", "th2", "th3"),
bg.color = "grey95",
marks = FALSE,
mark.size = 3,
mark.color = "grey20"
)# S4 method for igraph
plotGraphSpace(gs, ..., layout = NULL, mar = 0.075)
A ggplot-class object.
Either an igraph
or GraphSpace class object.
If gs
is an igraph
, then it must include x
, y
,
and name
vertex attributes (see GraphSpace
).
The title for the 'x' axis of a 2D-image space.
The title for the 'y' axis of a 2D-image space.
A single numeric value passed to ggplot themes.
Name of a custom RGraphSpace theme. These themes (from 'th1' to 'th3') consist mainly of preconfigured ggplot settings, which the user can subsequently fine-tune within the resulting ggplot object.
A single color for background.
A logical value indicating whether to add 'marks' to vertex positions. Alternatively, this could be a vector listing vertex names.
A font size argument passed to geom_text
.
A color passed to geom_text
.
Additional arguments passed to the
plotGraphSpace
function.
an optional numeric matrix with two columns for x
and y
coordinates.
A single numeric value (in [0,1]
) indicating the size of
the outer margins as a fraction of the graph space.
Sysbiolab.
GraphSpace
# Load a demo igraph
data('gtoy1', package = 'RGraphSpace')
# Generate a ggplot for gtoy1
plotGraphSpace(gtoy1)
# Create a GraphSpace object
gs <- GraphSpace(gtoy1)
# Generate a ggplot for gs
plotGraphSpace(gs)
Run the code above in your browser using DataLab