From 98e4a70f5578262d80d632ab0cc0436b4d23c49b Mon Sep 17 00:00:00 2001 From: certara-jcraig <61294078+certara-jcraig@users.noreply.github.com> Date: Tue, 26 Sep 2023 07:40:58 -0700 Subject: [PATCH 1/2] default ylab plot text given vpc type --- R/plot.R | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/R/plot.R b/R/plot.R index 84667ef..059c3fc 100644 --- a/R/plot.R +++ b/R/plot.R @@ -113,8 +113,14 @@ plot.tidyvpcobj <- function(x, if (is.null(ylab)) { ylab <- - sprintf("Observed/Simulated probabilities and associated %s%% CI", - 100 * vpc$conf.level) + paste0( + ifelse(vpc_type == "continuous", "Percentiles", "Probabilities"), + sprintf(" and associated %s%% CI", + 100 * vpc$conf.level) + ) + if (is.null(vpc$stats)) { + ylab <- NULL + } if (isTRUE(vpc$predcor)) { ylab <- ifelse(length(ylab) == 0, "Prediction Corrected", From 8ddcec20ce06f61d67e225fb6e52219a8f241eab Mon Sep 17 00:00:00 2001 From: certara-jcraig <61294078+certara-jcraig@users.noreply.github.com> Date: Tue, 26 Sep 2023 09:58:36 -0700 Subject: [PATCH 2/2] update snapshots for new ylab default --- .../_snaps/plot/bins-without-stats.svg | 1038 ++++++++--------- .../_snaps/plot/censored-plot-with-aql.svg | 12 +- .../plot/censored-plot-with-bql-aql.svg | 12 +- .../_snaps/plot/censored-plot-with-bql.svg | 12 +- ...ne-sided-strat-formula-with-facet-wrap.svg | 2 +- ...wo-sided-strat-formula-with-facet-grid.svg | 2 +- 6 files changed, 539 insertions(+), 539 deletions(-) diff --git a/tests/testthat/_snaps/plot/bins-without-stats.svg b/tests/testthat/_snaps/plot/bins-without-stats.svg index 2a49aa1..48bf0e1 100644 --- a/tests/testthat/_snaps/plot/bins-without-stats.svg +++ b/tests/testthat/_snaps/plot/bins-without-stats.svg @@ -21,528 +21,528 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -0 -50 -100 -150 -200 -250 - - - - - - - - - - -0 -5 -10 -15 -TIME -Bins without stats +0 +50 +100 +150 +200 +250 + + + + + + + + + + +0 +5 +10 +15 +TIME +Bins without stats diff --git a/tests/testthat/_snaps/plot/censored-plot-with-aql.svg b/tests/testthat/_snaps/plot/censored-plot-with-aql.svg index a358ba8..8a75992 100644 --- a/tests/testthat/_snaps/plot/censored-plot-with-aql.svg +++ b/tests/testthat/_snaps/plot/censored-plot-with-aql.svg @@ -57,16 +57,16 @@ -Observed/Simulated probabilities and associated 95% CI +Percentiles and associated 95% CI - - + + - + @@ -1062,11 +1062,11 @@ -Observed/Simulated probabilities and associated 95% CI +Percentiles and associated 95% CI - + diff --git a/tests/testthat/_snaps/plot/censored-plot-with-bql-aql.svg b/tests/testthat/_snaps/plot/censored-plot-with-bql-aql.svg index 5a23a25..caea95d 100644 --- a/tests/testthat/_snaps/plot/censored-plot-with-bql-aql.svg +++ b/tests/testthat/_snaps/plot/censored-plot-with-bql-aql.svg @@ -66,16 +66,16 @@ -Observed/Simulated probabilities and associated 95% CI +Percentiles and associated 95% CI - - + + - + @@ -1394,11 +1394,11 @@ -Observed/Simulated probabilities and associated 95% CI +Percentiles and associated 95% CI - + diff --git a/tests/testthat/_snaps/plot/censored-plot-with-bql.svg b/tests/testthat/_snaps/plot/censored-plot-with-bql.svg index 8a2db2d..bd971de 100644 --- a/tests/testthat/_snaps/plot/censored-plot-with-bql.svg +++ b/tests/testthat/_snaps/plot/censored-plot-with-bql.svg @@ -57,16 +57,16 @@ -Observed/Simulated probabilities and associated 95% CI +Percentiles and associated 95% CI - - + + - + @@ -1069,11 +1069,11 @@ -Observed/Simulated probabilities and associated 95% CI +Percentiles and associated 95% CI - + diff --git a/tests/testthat/_snaps/plot/one-sided-strat-formula-with-facet-wrap.svg b/tests/testthat/_snaps/plot/one-sided-strat-formula-with-facet-wrap.svg index 06b43d9..e256863 100644 --- a/tests/testthat/_snaps/plot/one-sided-strat-formula-with-facet-wrap.svg +++ b/tests/testthat/_snaps/plot/one-sided-strat-formula-with-facet-wrap.svg @@ -858,7 +858,7 @@ TIME -Observed/Simulated probabilities and associated 95% CI +Percentiles and associated 95% CI Observed Percentiles (black lines) diff --git a/tests/testthat/_snaps/plot/two-sided-strat-formula-with-facet-grid.svg b/tests/testthat/_snaps/plot/two-sided-strat-formula-with-facet-grid.svg index 026a9ed..a8921fd 100644 --- a/tests/testthat/_snaps/plot/two-sided-strat-formula-with-facet-grid.svg +++ b/tests/testthat/_snaps/plot/two-sided-strat-formula-with-facet-grid.svg @@ -862,7 +862,7 @@ TIME -Observed/Simulated probabilities and associated 95% CI +Percentiles and associated 95% CI Observed Percentiles (black lines)