|
2 | 2 |
|
3 | 3 | setMethod("animate", signature(x="SpatRaster"), |
4 | 4 | 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 | + |
6 | 9 | if (missing(main)) { |
7 | 10 | main <- names(x) |
8 | 11 | } |
@@ -30,6 +33,9 @@ function(x, pause=0.25, main, range=NULL, maxcell=50000, n=1, ...) { |
30 | 33 |
|
31 | 34 | setMethod("animate", signature(x="SpatVector"), |
32 | 35 | 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)) |
33 | 39 |
|
34 | 40 | n <- max(1, round(n)) |
35 | 41 |
|
@@ -92,6 +98,9 @@ function(x, pause=0.25, main, n=1, vars=NULL, range=NULL, add=NULL, ...) { |
92 | 98 |
|
93 | 99 | setMethod("animate", signature(x="SpatVectorCollection"), |
94 | 100 | 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)) |
95 | 104 |
|
96 | 105 | n <- max(1, round(n)) |
97 | 106 | if (is.null(ext)) ext <- ext(x) |
|
0 commit comments