diff --git a/R/ppc-loo.R b/R/ppc-loo.R
index 77905962..bbdf64d9 100644
--- a/R/ppc-loo.R
+++ b/R/ppc-loo.R
@@ -189,7 +189,7 @@ ppc_loo_pit_overlay <- function(y,
geom_line(
aes(color = "y"),
data = function(x) dplyr::filter(x, .data$is_y),
- linewidth = 1,
+ linewidth = 1,
lineend = "round",
na.rm = TRUE) +
scale_x_continuous(
@@ -326,21 +326,23 @@ ppc_loo_pit_qq <- function(y,
y_lab <- "LOO-PIT (standard normal quantiles)"
}
- ggplot(data.frame(p = pit)) +
+ qq <- ggplot(data.frame(p = pit)) +
geom_qq(
aes(sample = .data$p),
distribution = theoretical,
color = get_color("m"),
size = size,
alpha = alpha) +
- geom_qq_line(
- aes(sample = .data$p),
+ geom_abline(
linetype = 2,
- distribution = theoretical,
- color = "black",
- fullrange = FALSE) +
+ color = "black") +
bayesplot_theme_get() +
labs(x = x_lab, y = y_lab)
+ if (compare == "uniform") {
+ qq + lims(x=c(0,1), y=c(0,1))
+ } else {
+ qq
+ }
}
diff --git a/tests/testthat/_snaps/ppc-loo/ppc-loo-pit-qq-default.svg b/tests/testthat/_snaps/ppc-loo/ppc-loo-pit-qq-default.svg
index 47fb8158..5093dd94 100644
--- a/tests/testthat/_snaps/ppc-loo/ppc-loo-pit-qq-default.svg
+++ b/tests/testthat/_snaps/ppc-loo/ppc-loo-pit-qq-default.svg
@@ -20,136 +20,130 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-0.0
-0.5
-1.0
-1.5
-
-
-
-
-
-
-
-
-
-
-0.00
-0.25
-0.50
-0.75
-1.00
-Uniform
+
+0.00
+0.25
+0.50
+0.75
+1.00
+
+
+
+
+
+
+
+
+
+
+
+0.00
+0.25
+0.50
+0.75
+1.00
+Uniform
LOO-PIT
-ppc_loo_pit_qq (default)
+ppc_loo_pit_qq (default)