sn_save_ggplot: Save as ggplot2

View source: R/output-save.R

sn_save_ggplotR Documentation

Save as ggplot2

Description

Save network as a ggplot2 object to file using ggsave.

Usage

sn_save_ggplot(
  network,
  filename,
  width = 7,
  height = 7,
  dpi = 300,
  title = NULL,
  ...
)

Arguments

network

A cograph_network object.

filename

Output filename.

width

Width in inches.

height

Height in inches.

dpi

Resolution for raster formats.

title

Optional plot title.

...

Additional arguments passed to ggsave.

Value

The output filename, invisibly.

Examples

## Not run: 
adj <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3)
net <- cograph(adj)
sn_save_ggplot(net, file.path(tempdir(), "network.pdf"))

## End(Not run)


cograph documentation built on April 1, 2026, 1:07 a.m.