Learn R Programming

plotdap (version 1.1.1)

bbox_set: 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
)

Value

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

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

Examples

Run this code
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)

Run the code above in your browser using DataLab