Learn R Programming

netplot (version 0.3-0)

set_gpar: Set/retrieve graphical parameters of a netplot object

Description

Set/retrieve graphical parameters of a netplot object

Usage

set_gpar(x, type, element, idx, ...)

set_edge_gpar(x, element, idx, ...)

set_vertex_gpar(x, element, idx, ...)

get_vertex_gpar(x, element, ..., idx)

get_edge_gpar(x, element, ..., idx)

get_gpar(x, type, element, ..., idx, simplify = TRUE)

Value

An object of class netplot with modified parameters.

Arguments

x

An object of class netplot.

type

Character. Either "edge" or "vertex".

element

Character. If "edge", then it can be either "line" or "arrow", otherwise it can be either "core" or "frame".

idx

(optional) Integer vector. Indices of the elements to be modified. When missing, all elements are modified.

...

Parameters to be modified/retrieved. This is passed to grid::editGrob via grid::gpar.

simplify

Logical. When TRUE it tries to simplify the result. Otherwise it returns a nested list.

Details

set_edge_gpar and set_vertex_gpar are shorthands for set_gpar(type = "edge", ...) and set_gpar(type = "vertex", ...) respectively.

get_edge_gpar and get_vertex_gpar are shorthands for get_gpar(type = "edge", ...) and get_gpar(type = "vertex", ...) respectively.

Examples

Run this code
library(igraph)
library(netplot)

x <- make_ring(5)

g <- nplot(x)

# Updating edge color
g <- set_edge_gpar(g, col = "gray80")

# Retrieving the color of the vertices (core)
get_vertex_gpar(g, element = "core", "fill", "lwd")

Run the code above in your browser using DataLab