Learn R Programming

RGraphSpace (version 1.0.6)

plotGraphSpace,GraphSpace-method: 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 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)

Value

A ggplot-class object.

Arguments

gs

Either an igraph or GraphSpace class object. If gs is an igraph, then it must include x, y, and name vertex attributes (see GraphSpace).

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 geom_text.

mark.color

A color passed to geom_text.

...

Additional arguments passed to the plotGraphSpace function.

layout

an optional numeric matrix with two columns for x and y coordinates.

mar

A single numeric value (in [0,1]) indicating the size of the outer margins as a fraction of the graph space.

Author

Sysbiolab.

See Also

GraphSpace

Examples

Run this code
# 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