Skip to content

Commit 3b321db

Browse files
committed
reposition [x-y]anchor when [x-y]sizemode='pixel', fixes #1493
1 parent d9662a6 commit 3b321db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/subplots.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ reposition <- function(obj, domains) {
416416
o <- obj[[i]]
417417
xs <- if (identical(o$xref, "paper")) {
418418
if (is.numeric(o$sizex)) obj[[i]]$sizex <- o$sizex * abs(diff(xdom))
419-
c("x", "x0", "x1")
419+
if (identical(o$xsizemode, "pixel")) "xanchor" else c("x", "x0", "x1")
420420
}
421421
for (j in xs) {
422422
if (is.numeric(o[[j]])) {
@@ -425,7 +425,7 @@ reposition <- function(obj, domains) {
425425
}
426426
ys <- if (identical(o$yref, "paper")) {
427427
if (is.numeric(o$sizey)) obj[[i]]$sizey <- o$sizey * abs(diff(ydom))
428-
c("y", "y0", "y1")
428+
if (identical(o$ysizemode, "pixel")) "yanchor" else c("y", "y0", "y1")
429429
}
430430
for (j in ys) {
431431
if (is.numeric(o[[j]])) {

0 commit comments

Comments
 (0)