1
0
Fork 0
mirror of https://github.com/sensebox/opensensmapr synced 2025-02-20 20:23:58 +01:00

expose mar for plot.sensebox(), fixes #12

This commit is contained in:
Norwin 2018-01-05 00:04:30 +01:00
parent 84dfc3226a
commit 8f70a242d0
Signed by: norwin
GPG key ID: 24BC059DE24C43A3

View file

@ -1,5 +1,5 @@
#' @export
plot.sensebox = function (x, ...) {
plot.sensebox = function (x, ..., mar = c(2,2,1,1)) {
if (
!requireNamespace("sf", quietly = TRUE) ||
!requireNamespace("maps", quietly = TRUE) ||
@ -21,7 +21,7 @@ plot.sensebox = function (x, ...) {
sf::st_geometry()
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(geom, add = T, col = x$exposure)
legend('left', legend = levels(x$exposure), col = 1:length(x$exposure), pch = 1)