wilkelab / ggridges

Ridgeline plots in ggplot2
https://wilkelab.org/ggridges
GNU General Public License v2.0
411 stars 31 forks source link

add flag to suppress "picking join bandwidth" message #19

Closed yonicd closed 6 years ago

yonicd commented 6 years ago

this message is obtrusive when printing many plots at once filling up the console. is there a way to suppress it? suppressMessage doesnt work, neither does sink

maybe a flag in the geom_?

https://github.com/clauswilke/ggridges/blob/9404c693f712fb2ba5b6d205704b4eccea68fe67/R/stats.R#L92

clauswilke commented 6 years ago

This StackOverflow post explains how to suppress the message. And you can also suppress the message by picking a joint bandwidth manually.

yonicd commented 6 years ago

non of those solutions work with ggridges print method.

picking a bandwidth for each facet in a 10x10 grid seems a counterproductive as compared with an option to not print that message, especially that the user cant do anything with that information given post plot printing.

clauswilke commented 6 years ago
screen shot 2018-04-11 at 9 50 29 am
aviast commented 6 years ago

Hmm. suppressMessages() isn't working when I'm producing a plot in markdown document.

This code still generates the message "## Picking joint bandwidth of 0.155"

suppressMessages(
  ggplot(ORG01, aes(x = Count, y = Employee)) +
    geom_density_ridges(rel_min_height = 0.001) +
    scale_y_discrete(name = NULL) +
    scale_x_sqrt(
      name = "Number of Employees\n(NB: Non-linear scale)",
      limits = c(0,260), expand = c(0,0), breaks = c(1,4,8,12,16)^2
    ) +
    background_grid(major = "xy", minor = "none") +
    theme_ridges()
)