From 14dc0f0aa0d927cae7a909700503cecd02a01b5c Mon Sep 17 00:00:00 2001 From: pchelle Date: Wed, 22 Oct 2025 12:13:33 -0400 Subject: [PATCH 1/2] Fixes #536 watermark position independent from scales --- R/utilities-background.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/utilities-background.R b/R/utilities-background.R index d2a6db90..34323839 100644 --- a/R/utilities-background.R +++ b/R/utilities-background.R @@ -270,7 +270,7 @@ addWatermark <- function(plotObject, watermark <- createWatermarkGrob(label = watermark, alpha = alpha) - plotObject <- plotObject + ggplot2::annotation_custom(grob = watermark, xmin = -Inf, ymin = -Inf, xmax = Inf, ymax = Inf) + plotObject <- plotObject + ggplot2::annotation_custom(grob = watermark, xmin = I(-Inf), ymin = I(-Inf), xmax = I(Inf), ymax = I(Inf)) return(plotObject) } @@ -345,7 +345,7 @@ setWatermark <- function(plotObject, watermark = watermarkConfiguration, alpha = alpha ) - newPlotObject$layers[[1]] <- dummyPlot$layer[[1]] + newPlotObject$layers[[1]] <- dummyPlot$layers[[1]] return(newPlotObject) } From 511f078042a4651b5935dc9a289f537997148480 Mon Sep 17 00:00:00 2001 From: pchelle Date: Thu, 23 Oct 2025 03:01:54 -0400 Subject: [PATCH 2/2] Update test snapshots --- tests/testthat/_snaps/pkratio/pkratioplot.svg | 13 ++----------- tests/testthat/_snaps/plot-obs-vs-pred/basic.svg | 13 ++----------- .../fold-distance-many-folds-diagonal.svg | 13 ++----------- .../plot-obs-vs-pred/fold-distance-many-folds.svg | 13 ++----------- .../plot-obs-vs-pred/fold-distance-one-fold.svg | 13 ++----------- .../fold-distance-several-folds.svg | 13 ++----------- .../fold-distance-simple-abline.svg | 13 ++----------- 7 files changed, 14 insertions(+), 77 deletions(-) diff --git a/tests/testthat/_snaps/pkratio/pkratioplot.svg b/tests/testthat/_snaps/pkratio/pkratioplot.svg index c2466a50..4fdb33be 100644 --- a/tests/testthat/_snaps/pkratio/pkratioplot.svg +++ b/tests/testthat/_snaps/pkratio/pkratioplot.svg @@ -27,20 +27,11 @@ - - - - - - - - - - + - + diff --git a/tests/testthat/_snaps/plot-obs-vs-pred/basic.svg b/tests/testthat/_snaps/plot-obs-vs-pred/basic.svg index b6c3d066..4cbe26f4 100644 --- a/tests/testthat/_snaps/plot-obs-vs-pred/basic.svg +++ b/tests/testthat/_snaps/plot-obs-vs-pred/basic.svg @@ -27,20 +27,11 @@ - - - - - - - - - - + - + diff --git a/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-many-folds-diagonal.svg b/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-many-folds-diagonal.svg index b0583b7b..c73b4209 100644 --- a/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-many-folds-diagonal.svg +++ b/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-many-folds-diagonal.svg @@ -27,20 +27,11 @@ - - - - - - - - - - + - + diff --git a/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-many-folds.svg b/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-many-folds.svg index a34ba682..2417bcda 100644 --- a/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-many-folds.svg +++ b/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-many-folds.svg @@ -27,20 +27,11 @@ - - - - - - - - - - + - + diff --git a/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-one-fold.svg b/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-one-fold.svg index b8f3184b..461f2632 100644 --- a/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-one-fold.svg +++ b/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-one-fold.svg @@ -27,20 +27,11 @@ - - - - - - - - - - + - + diff --git a/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-several-folds.svg b/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-several-folds.svg index 75cda67c..30179138 100644 --- a/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-several-folds.svg +++ b/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-several-folds.svg @@ -27,20 +27,11 @@ - - - - - - - - - - + - + diff --git a/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-simple-abline.svg b/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-simple-abline.svg index d1918740..6b637e5f 100644 --- a/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-simple-abline.svg +++ b/tests/testthat/_snaps/plot-obs-vs-pred/fold-distance-simple-abline.svg @@ -27,20 +27,11 @@ - - - - - - - - - - + - +