Revision a84e9ffb3ac841114d4db4e70036eab333d29d2f authored by R. Wayne Oldford on 10 May 2021, 06:10:05 UTC, committed by cran-robot on 10 May 2021, 06:10:05 UTC
1 parent bb4dcd2
Raw File
l_layer_bbox.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/l_layer.R
\name{l_layer_bbox}
\alias{l_layer_bbox}
\title{Get the bounding box of a layer.}
\usage{
l_layer_bbox(widget, layer = "root")
}
\arguments{
\item{widget}{widget path or layer object of class \code{'l_layer'}}

\item{layer}{layer id. If the widget argument is of class \code{'l_layer'}
then the layer argument is not used}
}
\value{
Numeric vector of length 4 with (xmin, ymin, xmax, ymax) of the
  bounding box
}
\description{
The bounding box of a layer returns the coordinates of the
  smallest rectangle that encloses all the elements of the layer.
}
\examples{
if(interactive()){

p <- with(iris, l_plot(Sepal.Length ~ Sepal.Width, color=Species))
l_layer_bbox(p, layer='model')

l <- l_layer_rectangle(p, x=0:1, y=30:31)
l_layer_bbox(p, l)

l_layer_bbox(p, 'root')

}
}
back to top