plot_signal: Plot a Signal on Top of a Given Graph

View source: R/plot_signal.R

plot_signalR Documentation

Plot a Signal on Top of a Given Graph

Description

Visualize a signal over a graph.

Usage

plot_signal(z, f, size = 0.75, limits = range(f))

Arguments

z

A list containing graph data. This list must have the following components:

  • sA An adjacency matrix or a sparse Matrix representation of the graph.

  • xy A matrix or dataframe containing the x and y coordinates of each node in the graph.

f

Signal to plot.

size

Numeric. Dot size for nodes. Default is 0.75.

limits

Set colormap limits.

Details

This function allows visualization of a graph signal f superimposed on the structure of a graph defined by z. It offers an intuitive way to analyze the behavior of graph signals in the vertex domain.

Note

If node coordinates xy are not provided, they will be calculated using spectral methods spectral_coords. For large graphs, this can be computationally intensive and may take significant time. Use with caution for large graphs if node coordinates are not supplied.

See Also

plot_graph, spectral_coords

Examples

f <- rnorm(length(grid1$xy[,1]))
plot_signal(grid1, f)

gasper documentation built on Oct. 27, 2023, 1:07 a.m.