bbox_set: change bounding box in plotdap object

View source: R/bbox_set.R

bbox_setR Documentation

change bounding box in plotdap object

Description

bbox_setchanges the bounding box in an plotdap object. Particularly needed if using gganimate::animate()

Usage

bbox_set(
  plotobj,
  landmask = TRUE,
  xlim = NULL,
  ylim = NULL,
  interactive = FALSE
)

Arguments

plotobj

valid plotdap object

landmask

optional: if true land is plotted over the data

xlim

optional: new x-values of the bounding box otherwise taken from the plotdap object

ylim

optional: new y-values of the bounding box otherwise taken from the plotdap object

interactive

optional: if true creates an interactive version of the graphic

Value

a ggplot object with reset limits. If interactive is true, then returns a ggplot object that will work with the 'plotly' package.

Examples

p <- plotdap()
p <- add_tabledap(p, sardines, ~subsample_count)
xlim = c(-125, -115)
ylim <- c(30., 50.)
p <- bbox_set(p, xlim = xlim, ylim = ylim)

plotdap documentation built on Jan. 10, 2026, 9:06 a.m.