Learn R Programming

graphlayouts (version 1.2.2)

layout_manipulate: manipulate layout

Description

functions to manipulate an existing layout

Usage

layout_rotate(xy, angle)

layout_mirror(xy, axis = "vertical")

Value

manipulated matrix of xy coordinates

Arguments

xy

graph layout

angle

angle for rotation

axis

mirror horizontal or vertical

Author

David Schoch

Details

These functions are mostly useful for deterministic layouts such as layout_with_stress

Examples

Run this code
library(igraph)
g <- sample_gnp(50, 0.3)

xy <- layout_with_stress(g)

# rotate 90 degrees
xy <- layout_rotate(xy, 90)

# flip horizontally
xy <- layout_mirror(xy, "horizontal")

Run the code above in your browser using DataLab