Skip to content

Commit

Permalink
Modify cex in ggbeeswarm::geom_beeswarm to scale better
Browse files Browse the repository at this point in the history
  • Loading branch information
LHBO committed Oct 12, 2024
1 parent ddd32c7 commit 52ee68d
Show file tree
Hide file tree
Showing 2 changed files with 560 additions and 2 deletions.
3 changes: 1 addition & 2 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,7 @@ make_beeswarm_plot <- function(dt_plot, col, index_x_explain, x, factor_cols) {

gg <- ggplot2::ggplot(dt_plot, ggplot2::aes(x = variable, y = phi, color = feature_value_scaled)) +
ggplot2::geom_hline(yintercept = 0, color = "grey70", linewidth = 0.5) +
ggbeeswarm::geom_beeswarm(priority = "random", cex = 0.4) +
# the cex-parameter doesnt generalize well, should use corral but not available yet....
ggbeeswarm::geom_beeswarm(priority = "random", cex = 1 / length(index_x_explain)^(1/4)) +
ggplot2::coord_flip() +
ggplot2::theme_classic() +
ggplot2::theme(panel.grid.major.y = ggplot2::element_line(colour = "grey90", linetype = "dashed")) +
Expand Down
Loading

0 comments on commit 52ee68d

Please sign in to comment.