Plot a mesh object

plot_mesh(mesh, file_name = NULL)

Arguments

mesh

A mesh object from sdmTMB::make_mesh()

file_name

Optional file path to save the plot. If NULL, plot is returned but not saved.

Value

A ggplot object

Examples

if (FALSE) { # \dontrun{
mesh <- sdmTMB::make_mesh(data, xy_cols = c("x", "y"), n_knots = 500)

# Return plot without saving
p <- plot_mesh(mesh, file_name = NULL)
print(p)
} # }