Learn R Programming

gasper (version 1.1.6)

plot_graph: Plot Graph

Description

Visualizes a graph using ggplot2. It plots nodes as points and edges as segments connecting these points.

Usage

plot_graph(z, size = 0.75)

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.

size

Numeric. Dot size for nodes. Default is 0.75.

Details

The function is primarily designed to work with the output from the download_graph function. This ensures that the graph visualization upholds the structure and properties of the retrieved graph. However, the function can also be utilized to visualize custom graph structures, provided they match to the input format.

See Also

download_graph, plot_signal, spectral_coords

Examples

Run this code
data(grid1)
plot_graph(grid1)

Run the code above in your browser using DataLab