bayesplot icon indicating copy to clipboard operation
bayesplot copied to clipboard

allow to change the legend text in ppc_intervals() and related functions

Open mcol opened this issue 6 years ago • 3 comments

These are currently hardcoded as y and yrep, but it may be helpful to provide an easy way to override the defaults.

mcol avatar Jun 04 '18 12:06 mcol

Hmm, we could export our colorizers.

library(bayesplot)
library(ggplot2)

y <- rnorm(50)
yrep <- matrix(rnorm(5000, 0, 2), ncol = 50)

color_scheme_set("darkgray")

ppc_intervals(y, yrep) + 
  bayesplot:::scale_color_ppc_dist(labels = c("no", "yes")) + 
  bayesplot:::scale_fill_ppc_dist(labels = c("no", "yes"))

image

Or do some kind of scale_color_bayesplot() which wraps scale_color_manual() so that it gets the current bayesplot color-scheme. I think that using a function to customize a plot is better than creating more options for functions to handle.

tjmahr avatar Jun 06 '18 12:06 tjmahr

@mcol Thanks, yeah I agree this would be nice. @tjmahr Yeah, fully agree. A function for this would be great.

jgabry avatar Jun 10 '18 19:06 jgabry

Looks like a duplicate issue to #75.

silberzwiebel avatar Aug 27 '18 10:08 silberzwiebel