set_gpar: Set/retrieve graphical parameters of a 'netplot' object

View source: R/gpar.R

set_gparR Documentation

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)

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.

Value

An object of class netplot with modified parameters.

Examples

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


netplot documentation built on July 1, 2024, 1:06 a.m.