Skip to content

Commit 2da47cf

Browse files
committed
avoid max() to get scale factors
1 parent b83bf26 commit 2da47cf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

R/plotLabel.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ setMethod("plotLabel", "SpatialData", \(x, i=1, j=1, k=NULL, c=NULL,
9191
ty <- t[length(t)-1L]
9292
.x <- tx*idx[, 2L]
9393
.y <- ty*idx[, 1L]
94+
mx <- dim(ym)[2]*tx
95+
my <- dim(ym)[1]*ty
9496
df <- data.frame(
95-
x = .x*(wh$w[2]/max(.x))+wh$w[1],
96-
y = .y*(wh$h[2]/max(.y))+wh$h[1],
97+
x = .x*(wh$w[2]/mx)+wh$w[1],
98+
y = .y*(wh$h[2]/my)+wh$h[1],
9799
z = ym[idx])
98100

99101
aes <- aes(.data[["x"]], .data[["y"]])

0 commit comments

Comments
 (0)