Skip to content

Commit

Permalink
Merge pull request #252 from epiforecasts/fix-ggplot2-update
Browse files Browse the repository at this point in the history
Fix ggplot2 update
  • Loading branch information
nikosbosse authored Nov 17, 2022
2 parents 5b6cd5f + b7f896a commit 1bffc42
Show file tree
Hide file tree
Showing 24 changed files with 590 additions and 1,165 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ Encoding: UTF-8
LazyData: true
Imports:
data.table,
ggdist (>= 3.1.0),
ggplot2,
ggdist (>= 3.2.0),
ggplot2 (>= 3.4.0),
methods,
rlang,
scoringRules,
Expand All @@ -64,7 +64,7 @@ Config/Needs/website:
r-lib/pkgdown,
amirmasoudabdol/preferably
Config/testthat/edition: 3
RoxygenNote: 7.2.0
RoxygenNote: 7.2.1
URL: https://epiforecasts.io/scoringutils/, https://github.com/epiforecasts/scoringutils
BugReports: https://github.com/epiforecasts/scoringutils/issues
VignetteBuilder: knitr
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ importFrom(ggdist,geom_lineribbon)
importFrom(ggplot2,.data)
importFrom(ggplot2,`%+replace%`)
importFrom(ggplot2,aes)
importFrom(ggplot2,after_stat)
importFrom(ggplot2,coord_cartesian)
importFrom(ggplot2,coord_flip)
importFrom(ggplot2,element_blank)
Expand Down
8 changes: 4 additions & 4 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ plot_ranges <- function(scores,
geom_point(size = 2) +
geom_line(aes(group = range),
colour = "black",
size = 0.01
linewidth = 0.01
) +
scale_color_continuous(low = "steelblue", high = "salmon") +
theme_scoringutils() +
Expand Down Expand Up @@ -993,7 +993,7 @@ plot_pairwise_comparison <- function(comparison_result,
#' # sample-based pit
#' pit <- pit(example_integer, by = c("model"))
#' plot_pit(pit)
#' @importFrom ggplot2 ggplot aes xlab ylab geom_histogram stat theme_light
#' @importFrom ggplot2 ggplot aes xlab ylab geom_histogram stat theme_light after_stat
#' @export

plot_pit <- function(pit,
Expand Down Expand Up @@ -1054,7 +1054,7 @@ plot_pit <- function(pit,
data = pit,
aes(x = pit_value)
) +
geom_histogram(aes(y = stat(width * density)),
geom_histogram(aes(y = after_stat(width * density)),
breaks = plot_quantiles,
colour = "grey"
) +
Expand All @@ -1066,7 +1066,7 @@ plot_pit <- function(pit,
data = data.frame(x = pit),
aes(x = x)
) +
geom_histogram(aes(y = stat(width*density)),
geom_histogram(aes(y = after_stat(width * density)),
breaks = plot_quantiles,
colour = "grey"
)
Expand Down
168 changes: 84 additions & 84 deletions tests/testthat/_snaps/plot_avail_forecasts/plot-avail-forecasts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 28 additions & 28 deletions tests/testthat/_snaps/plot_correlation/plot-correlation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1bffc42

Please sign in to comment.