Skip to content

Commit f388e34

Browse files
committed
Merge branch 'master' of https://github.com/rspatial/terra
2 parents 999cce8 + 8ed983f commit f388e34

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

R/animate.R

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
setMethod("animate", signature(x="SpatRaster"),
44
function(x, pause=0.25, main, range=NULL, maxcell=50000, n=1, ...) {
5-
5+
old.par <- graphics::par(no.readonly=TRUE)
6+
on.exit(graphics::par(old.par))
7+
graphics::par(mfrow=c(1, 1))
8+
69
if (missing(main)) {
710
main <- names(x)
811
}
@@ -30,6 +33,9 @@ function(x, pause=0.25, main, range=NULL, maxcell=50000, n=1, ...) {
3033

3134
setMethod("animate", signature(x="SpatVector"),
3235
function(x, pause=0.25, main, n=1, vars=NULL, range=NULL, add=NULL, ...) {
36+
old.par <- graphics::par(no.readonly=TRUE)
37+
on.exit(graphics::par(old.par))
38+
graphics::par(mfrow=c(1, 1))
3339

3440
n <- max(1, round(n))
3541

@@ -92,6 +98,9 @@ function(x, pause=0.25, main, n=1, vars=NULL, range=NULL, add=NULL, ...) {
9298

9399
setMethod("animate", signature(x="SpatVectorCollection"),
94100
function(x, pause=0.25, n=1, vars=NULL, range=NULL, ext=NULL, add=NULL, ...) {
101+
old.par <- graphics::par(no.readonly=TRUE)
102+
on.exit(graphics::par(old.par))
103+
graphics::par(mfrow=c(1, 1))
95104

96105
n <- max(1, round(n))
97106
if (is.null(ext)) ext <- ext(x)

0 commit comments

Comments
 (0)