From d97e7d914ef4e90895df73df89abcee0ce8a463b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teemu=20S=C3=A4ilynoja?= Date: Fri, 19 Jan 2024 16:07:19 +0200 Subject: [PATCH] Updated y-axis label on ecdf difference plots. --- R/ppc-distributions.R | 4 ++-- tests/testthat/_snaps/ppc-distributions/ppc-pit-ecdf-diff.svg | 2 +- .../_snaps/ppc-distributions/ppc-pit-ecdf-grouped-diff.svg | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/ppc-distributions.R b/R/ppc-distributions.R index 73b32e34..eb0f0f31 100644 --- a/R/ppc-distributions.R +++ b/R/ppc-distributions.R @@ -647,7 +647,7 @@ ppc_pit_ecdf <- function(y, color = "yrep" ), linetype = 2, show.legend = FALSE) + - labs(y = "ECDF", x = "PIT") + + labs(y = ifelse(plot_diff,"ECDF - difference","ECDF"), x = "PIT") + yaxis_ticks(FALSE) + scale_color_ppc() + bayesplot_theme_get() @@ -735,7 +735,7 @@ ppc_pit_ecdf_grouped <- color = "yrep" ), linetype = 2, show.legend = FALSE) + - labs(y = "ECDF", x = "PIT") + + labs(y = ifelse(plot_diff,"ECDF - difference","ECDF"), x = "PIT") + yaxis_ticks(FALSE) + bayesplot_theme_get() + facet_wrap("group") + diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-pit-ecdf-diff.svg b/tests/testthat/_snaps/ppc-distributions/ppc-pit-ecdf-diff.svg index f5f91cd0..c8888419 100644 --- a/tests/testthat/_snaps/ppc-distributions/ppc-pit-ecdf-diff.svg +++ b/tests/testthat/_snaps/ppc-distributions/ppc-pit-ecdf-diff.svg @@ -51,7 +51,7 @@ 0.75 1.00 PIT -ECDF +ECDF - difference ppc_pit_ecdf (diff) diff --git a/tests/testthat/_snaps/ppc-distributions/ppc-pit-ecdf-grouped-diff.svg b/tests/testthat/_snaps/ppc-distributions/ppc-pit-ecdf-grouped-diff.svg index b3329c23..a62e2778 100644 --- a/tests/testthat/_snaps/ppc-distributions/ppc-pit-ecdf-grouped-diff.svg +++ b/tests/testthat/_snaps/ppc-distributions/ppc-pit-ecdf-grouped-diff.svg @@ -151,7 +151,7 @@ PIT -ECDF +ECDF - difference ppc_pit_ecdf_grouped (diff)