Skip to content

Commit b7d1279

Browse files
committed
am
1 parent 87102c0 commit b7d1279

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

R/plot_raster.R

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@
370370

371371
if (x$add) {
372372
reset.clip()
373+
x$zebra <- FALSE
373374
} else if (!x$legend_only) {
374375
old.mar <- graphics::par()$mar
375376
if (!any(is.na(x$mar))) { graphics::par(mar=x$mar) }
@@ -398,12 +399,6 @@
398399
if (!x$legend_only) {
399400
graphics::rasterImage(x$r, x$ext[1], x$ext[3], x$ext[2], x$ext[4], angle = 0, interpolate = x$interpolate)
400401
x <- .plot.axes(x)
401-
if (x$zebra) {
402-
try(set.clip(x$lim, x$lonlat))
403-
zebra(width=width, x=x$axs$xat, y=x$axs$yat)
404-
x$lim[1:2] <- x$lim[1:2] + c(width[1], -width[1])
405-
x$lim[3:4] <- x$lim[3:4] + c(width[2], -width[2])
406-
}
407402
}
408403

409404
if (x$legend_draw) {
@@ -430,6 +425,14 @@
430425
x$leg$used <- do.call(.plot.class.legend, x$leg)
431426
}
432427
}
428+
429+
if (x$zebra) {
430+
try(set.clip(x$lim, x$lonlat))
431+
zebra(width=width, x=x$axs$xat, y=x$axs$yat)
432+
x$lim[1:2] <- x$lim[1:2] + c(width[1], -width[1])
433+
x$lim[3:4] <- x$lim[3:4] + c(width[2], -width[2])
434+
}
435+
433436
if (isTRUE(x$box)) {
434437
if (x$clip) {
435438
lines(ext(x$lim))

R/plot_vector.R

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ setMethod("dots", signature(x="SpatVector"),
351351
if (!is.null(out$background)) {
352352
graphics::rect(out$lim[1], out$lim[3], out$lim[2], out$lim[4], col=out$background, border=x$box)
353353
}
354+
} else {
355+
x$zebra <- FALSE
354356
}
355357
if (isTRUE(out$blank)) return(out)
356358

@@ -392,11 +394,6 @@ setMethod("dots", signature(x="SpatVector"),
392394
}
393395

394396
out <- .plot.axes(out)
395-
if (out$zebra) {
396-
zebra(width=width, x=out$axs$xat, y=out$axs$yat)
397-
out$lim[1:2] <- out$lim[1:2] + c(width[1], -width[1])
398-
out$lim[3:4] <- out$lim[3:4] + c(width[2], -width[2])
399-
}
400397

401398
if (out$legend_draw) {
402399
if (out$legend_type == "continuous") {
@@ -421,6 +418,13 @@ setMethod("dots", signature(x="SpatVector"),
421418
out$legpars <- do.call(.plot.class.legend, out$leg)
422419
}
423420
}
421+
422+
if (out$zebra) {
423+
zebra(width=width, x=out$axs$xat, y=out$axs$yat)
424+
out$lim[1:2] <- out$lim[1:2] + c(width[1], -width[1])
425+
out$lim[3:4] <- out$lim[3:4] + c(width[2], -width[2])
426+
}
427+
424428
if (isTRUE(out$box)) {
425429
if (out$clip) {
426430
lines(ext(out$lim))

0 commit comments

Comments
 (0)