From 5151d863742e878aa0dd30014d6839de7291b096 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 10 Jun 2024 08:48:39 +0200 Subject: [PATCH] adjust y scale --- DESCRIPTION | 2 +- NEWS.md | 7 +++++++ R/plot.check_normality.R | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1ca05bb5d..0ee2994ee 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: see Title: Model Visualisation Toolbox for 'easystats' and 'ggplot2' -Version: 0.8.4.3 +Version: 0.8.4.4 Authors@R: c(person(given = "Daniel", family = "Lüdecke", diff --git a/NEWS.md b/NEWS.md index 0aa08dc6a..0d14f6798 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +# see 0.8.5 + +## Minor Changes + +* Improved scaling for detrended QQ plots when package *qqplotr* is not installed. + The normal and the detrended QQ plots are now visually more similar. + # see 0.8.4 ## Minor Changes diff --git a/R/plot.check_normality.R b/R/plot.check_normality.R index 2f6fab268..f24100597 100644 --- a/R/plot.check_normality.R +++ b/R/plot.check_normality.R @@ -279,6 +279,7 @@ plot.see_check_normality <- function(x, # to scale the detrended qq plot N <- length(x$y) SD <- stats::sd(x$y) * sqrt((N - 1) / N) + y_range <- c(min(pretty(range(x$y), n = 2)), max(pretty(range(x$y), n = 2))) gg_init <- ggplot2::ggplot(x, ggplot2::aes(sample = .data$y)) @@ -307,7 +308,10 @@ plot.see_check_normality <- function(x, stroke = 0, size = size_point, colour = colors[2] - ) + ), + if (detrend) { + ggplot2::ylim(y_range) + } ) if (detrend) {