Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot.see_parameters_model: option to turn off group colours for dot-and-whisker plots #235

Open
egouldo opened this issue Aug 12, 2022 · 1 comment
Labels
enhancement 🔥 New feature or request

Comments

@egouldo
Copy link

egouldo commented Aug 12, 2022

Can the colours for CI groups (< y_intercept / > y_intercept, ref'd below) be made optional? It's not clear to the reader what the colour represents. For these type of coefficient plots I think colour is typically used to represent the significance level of the estimate, so I had to cross-check against the raw values to realise this wasn't the case.

Also, documentation could be amended to explain this behaviour - I had to toggle off/on the legend and then dig into the function code before I understood how the colours were determined.

# plot setup for model parameters with multiple CIs
x$CI <- as.character(x$CI)
x$group <- factor(x$Coefficient < y_intercept, levels = c(FALSE, TRUE))
if (all(x$group == "TRUE")) {
color_scale <- scale_color_material(reverse = TRUE)
} else {
color_scale <- scale_color_material()
}
p <- ggplot2::ggplot(x, ggplot2::aes(
y = .data$Parameter, x = .data$Coefficient,
size = rev(.data$CI), color = .data$group
)) +
ggplot2::geom_vline(ggplot2::aes(xintercept = y_intercept), linetype = "dotted") +
theme_modern(legend.position = "none") +
color_scale

@nlubock
Copy link

nlubock commented Jul 14, 2023

Agreed - this is quite confusing for undocumented behavior. Would be great if this was noted or removed!

@strengejacke strengejacke added the enhancement 🔥 New feature or request label Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🔥 New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants