Skip to content

Commit

Permalink
Fxes #383
Browse files Browse the repository at this point in the history
  • Loading branch information
spsanderson committed Dec 18, 2023
1 parent 965aa22 commit d65cf63
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dplyr in favor of using `dplyr::pick()`
4. Fix #381 - Add `tidy_triangular()` to all autoplot functions.
5. Fix #385 - For `tidy_multi_dist_autoplot()` the `.plot_type = "quantile"` did
not work.
6. Fix #383 - Update all autoplot functions to use linewidth instead of size.

# TidyDensity 1.2.6

Expand Down
12 changes: 6 additions & 6 deletions R/autoplot-combined-dist.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ tidy_combined_autoplot <- function(.data, .plot_type = "density", .line_size = .
color = dist_type
)
) +
ggplot2::geom_line(size = line_size) +
ggplot2::geom_line(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::labs(
title = "Density Plot",
Expand Down Expand Up @@ -163,7 +163,7 @@ tidy_combined_autoplot <- function(.data, .plot_type = "density", .line_size = .
color = dist_type
)
) +
ggplot2::geom_line(size = line_size) +
ggplot2::geom_line(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::labs(
title = "Quantile Plot",
Expand All @@ -182,7 +182,7 @@ tidy_combined_autoplot <- function(.data, .plot_type = "density", .line_size = .
color = dist_type
)
) +
ggplot2::stat_ecdf(size = line_size) +
ggplot2::stat_ecdf(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::labs(
title = "Probability Plot",
Expand All @@ -201,7 +201,7 @@ tidy_combined_autoplot <- function(.data, .plot_type = "density", .line_size = .
)
) +
ggplot2::stat_qq(size = point_size) +
ggplot2::stat_qq_line(size = line_size) +
ggplot2::stat_qq_line(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::labs(
title = "QQ Plot",
Expand All @@ -211,11 +211,11 @@ tidy_combined_autoplot <- function(.data, .plot_type = "density", .line_size = .
ggplot2::theme(legend.position = leg_pos)
} else if (plot_type == "mcmc") {
plt <- data_tbl %>%
dplyr::group_by(sim_number) %>%
dplyr::group_by(sim_number, dist_type) %>%
dplyr::mutate(cmy = dplyr::cummean(y)) %>%
dplyr::ungroup() %>%
ggplot2::ggplot(ggplot2::aes(
x = x, y = cmy, group = sim_number, color = sim_number
x = x, y = cmy, group = interaction(dist_type, sim_number), color = sim_number
)) +
ggplot2::geom_line() +
ggplot2::theme_minimal() +
Expand Down
14 changes: 7 additions & 7 deletions R/autoplot-multi-dist.R
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ tidy_multi_dist_autoplot <- function(.data, .plot_type = "density", .line_size =
ggplot2::ggplot(
ggplot2::aes(x = dx, y = dy, group = interaction(dist_name, sim_number), color = dist_name)
) +
ggplot2::geom_line(size = line_size) +
ggplot2::geom_line(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::labs(
title = "Density Plot",
Expand Down Expand Up @@ -266,7 +266,7 @@ tidy_multi_dist_autoplot <- function(.data, .plot_type = "density", .line_size =
x = x, y = q, group = interaction(dist_name, sim_number), color = dist_name
)
) +
ggplot2::geom_line(size = line_size) +
ggplot2::geom_line(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::labs(
title = "Quantile Plot",
Expand All @@ -281,7 +281,7 @@ tidy_multi_dist_autoplot <- function(.data, .plot_type = "density", .line_size =
x = y, group = interaction(dist_name, sim_number), color = dist_name
)
) +
ggplot2::stat_ecdf(size = line_size) +
ggplot2::stat_ecdf(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::labs(
title = "Probability Plot",
Expand All @@ -297,7 +297,7 @@ tidy_multi_dist_autoplot <- function(.data, .plot_type = "density", .line_size =
)
) +
ggplot2::stat_qq(size = point_size) +
ggplot2::stat_qq_line(size = line_size) +
ggplot2::stat_qq_line(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::labs(
title = "QQ Plot",
Expand All @@ -307,13 +307,13 @@ tidy_multi_dist_autoplot <- function(.data, .plot_type = "density", .line_size =
ggplot2::theme(legend.position = leg_pos)
} else if (plot_type == "mcmc") {
plt <- data_tbl %>%
dplyr::group_by(sim_number) %>%
dplyr::group_by(sim_number, dist_name) %>%
dplyr::mutate(cmy = dplyr::cummean(y)) %>%
dplyr::ungroup() %>%
ggplot2::ggplot(ggplot2::aes(
x = x, y = cmy, group = sim_number, color = sim_number
x = x, y = cmy, group = interaction(dist_name, sim_number), color = sim_number
)) +
ggplot2::geom_line() +
ggplot2::geom_line(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::scale_x_continuous(trans = "log10") +
ggplot2::labs(
Expand Down
4 changes: 2 additions & 2 deletions R/autoplot-randomwalk.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#' @export
#'

tidy_random_walk_autoplot <- function(.data, .line_size = 1, .geom_rug = FALSE,
tidy_random_walk_autoplot <- function(.data, .line_size = .5, .geom_rug = FALSE,
.geom_smooth = FALSE, .interactive = FALSE) {

# Tidyeval ----
Expand Down Expand Up @@ -165,7 +165,7 @@ tidy_random_walk_autoplot <- function(.data, .line_size = 1, .geom_rug = FALSE,
x = x, y = random_walk_value,
group = sim_number, color = sim_number
)) +
ggplot2::geom_line(size = line_size) +
ggplot2::geom_line(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::labs(
title = "Random Walk Plot",
Expand Down
10 changes: 5 additions & 5 deletions R/autoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ tidy_autoplot <- function(.data, .plot_type = "density", .line_size = .5,
ggplot2::ggplot(
ggplot2::aes(x = dx, y = dy, group = sim_number, color = sim_number)
) +
ggplot2::geom_line(size = line_size) +
ggplot2::geom_line(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::labs(
title = "Density Plot",
Expand Down Expand Up @@ -258,7 +258,7 @@ tidy_autoplot <- function(.data, .plot_type = "density", .line_size = .5,
x = x, y = q, group = sim_number, color = sim_number
)
) +
ggplot2::geom_line(size = line_size) +
ggplot2::geom_line(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::labs(
title = "Quantile Plot",
Expand All @@ -271,7 +271,7 @@ tidy_autoplot <- function(.data, .plot_type = "density", .line_size = .5,
ggplot2::ggplot(
ggplot2::aes(x = y, color = sim_number, group = sim_number)
) +
ggplot2::stat_ecdf(size = line_size) +
ggplot2::stat_ecdf(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::labs(
title = "Probability Plot",
Expand All @@ -287,7 +287,7 @@ tidy_autoplot <- function(.data, .plot_type = "density", .line_size = .5,
)
) +
ggplot2::stat_qq(size = point_size) +
ggplot2::stat_qq_line(size = line_size) +
ggplot2::stat_qq_line(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::labs(
title = "QQ Plot",
Expand All @@ -303,7 +303,7 @@ tidy_autoplot <- function(.data, .plot_type = "density", .line_size = .5,
ggplot2::ggplot(ggplot2::aes(
x = x, y = cmy, group = sim_number, color = sim_number
)) +
ggplot2::geom_line() +
ggplot2::geom_line(linewidth = line_size) +
ggplot2::theme_minimal() +
ggplot2::scale_x_continuous(trans = "log10") +
ggplot2::labs(
Expand Down
2 changes: 1 addition & 1 deletion man/tidy_random_walk_autoplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d65cf63

Please sign in to comment.