Skip to content

Commit

Permalink
adjust y scale
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jun 10, 2024
1 parent 2029646 commit 5151d86
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 5 additions & 1 deletion R/plot.check_normality.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 5151d86

Please sign in to comment.