plotGraphSpace,GraphSpace-method {RGraphSpace} | R Documentation |
Plotting igraph objects with RGraphSpace package
Description
plotGraphSpace
is a wrapper function to
create dedicated ggplot graphics for igraph- and GraphSpace-class objects.
Usage
## S4 method for signature '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 signature 'igraph'
plotGraphSpace(gs, ..., layout = NULL, mar = 0.075)
Arguments
gs |
Either an |
xlab |
The title for the 'x' axis of a 2D-image space. |
ylab |
The title for the 'y' axis of a 2D-image space. |
font.size |
A single numeric value passed to ggplot themes. |
theme |
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. |
bg.color |
A single color for background. |
marks |
A logical value indicating whether to add 'marks' to vertex positions. Alternatively, this could be a vector listing vertex names. |
mark.size |
A font size argument passed to |
mark.color |
A color passed to |
... |
Additional arguments passed to the
|
layout |
an optional numeric matrix with two columns for |
mar |
A single numeric value (in |
Value
A ggplot-class object.
Author(s)
Sysbiolab.
See Also
Examples
# 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)