Learn R Programming

RGraphSpace (version 1.0.9)

plotGraphSpace,GraphSpace-method: Plotting igraph objects with RGraphSpace

Description

plotGraphSpace is a wrapper function to create dedicated ggplot graphics for igraph- and GraphSpace-class objects.

Usage

# S4 method for GraphSpace
plotGraphSpace(
  gs,
  theme = c("th0", "th1", "th2", "th3"),
  xlab = "Graph coordinates 1",
  ylab = "Graph coordinates 2",
  font.size = 1,
  bg.color = "grey95",
  add.labels = FALSE,
  node.labels = NULL,
  label.size = 3,
  label.color = "grey20",
  add.image = FALSE,
  marks = deprecated(),
  mark.size = deprecated(),
  mark.color = deprecated()
)

# S4 method for igraph plotGraphSpace(gs, ..., mar = 0.1)

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

theme

Name of a custom RGraphSpace theme. These themes (from 'th1' to 'th3') consist of preconfigured ggplot settings, which the user can subsequently refine using ggplot2.

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.

bg.color

A single color for background.

add.labels

A logical value indicating whether to plot vertex labels.

node.labels

A vector of vertex names to be highlighted in the graph space. This argument overrides 'add.labels'.

label.size

A size argument passed to geom_text.

label.color

A color passed to geom_text.

add.image

A logical value indicating whether to add a background image, when one is available (see GraphSpace).

marks

Deprecated from RGraphSpace 1.0.9; use 'node.labels' instead.

mark.size

Deprecated from RGraphSpace 1.0.9; use 'label.size' instead.

mark.color

Deprecated from RGraphSpace 1.0.9; use 'label.color' instead.

...

Additional arguments passed to the plotGraphSpace function.

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 igraph
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