mirror of
https://github.com/sensebox/opensensmapr
synced 2025-02-22 14:53:57 +01:00
expose mar for plot.sensebox(), fixes #12
This commit is contained in:
parent
84dfc3226a
commit
8f70a242d0
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
#' @export
|
#' @export
|
||||||
plot.sensebox = function (x, ...) {
|
plot.sensebox = function (x, ..., mar = c(2,2,1,1)) {
|
||||||
if (
|
if (
|
||||||
!requireNamespace("sf", quietly = TRUE) ||
|
!requireNamespace("sf", quietly = TRUE) ||
|
||||||
!requireNamespace("maps", quietly = TRUE) ||
|
!requireNamespace("maps", quietly = TRUE) ||
|
||||||
|
@ -21,7 +21,7 @@ plot.sensebox = function (x, ...) {
|
||||||
sf::st_geometry()
|
sf::st_geometry()
|
||||||
|
|
||||||
oldpar = par()
|
oldpar = par()
|
||||||
par(mar = c(2,2,1,1))
|
par(mar = mar)
|
||||||
plot(world, col = 'gray', xlim = bbox[c(1,3)], ylim = bbox[c(2,4)], axes = T)
|
plot(world, col = 'gray', xlim = bbox[c(1,3)], ylim = bbox[c(2,4)], axes = T)
|
||||||
plot(geom, add = T, col = x$exposure)
|
plot(geom, add = T, col = x$exposure)
|
||||||
legend('left', legend = levels(x$exposure), col = 1:length(x$exposure), pch = 1)
|
legend('left', legend = levels(x$exposure), col = 1:length(x$exposure), pch = 1)
|
||||||
|
|
Loading…
Add table
Reference in a new issue