Control alpha of ribbons in conditional_effects plot

Hi,
I have the following (section of a) plot and would like to change the alpha value of the ribbons. Changing the alpha value correctly controls the lines themselves, but not the ribbons.

A minimal reproducible example is

library(tidyverse)
library(brms)
data <- data.frame(subject = rep(rep(c(1:10),5), 10),
                   judge   = sort(rep(c(1:5), 100)),
                   distance = runif(500),
                   response = round(runif(500,1,6)))


fit <- brm(data = data,
           response ~ distance + (1|subject) + (1|judge),
           family = cumulative("probit"),
           chains = 1, 
           save_all_pars = TRUE)

conditional_effects(fit, categorical = TRUE)


ce <- conditional_effects(fit, categorical = TRUE)
plot(ce)[[1]] +
  facet_wrap("cats__")

I tried two things, none of them worked:

# I tried
plot(ce, line_args(alpha=0.8))[[1]] +
  facet_wrap("cats__")

# And also tried
plot(ce)[[1]] +
  facet_wrap("cats__") +
  scale_color_manual(values = alpha(c("#E69F00", "#56B4E9", "#009E73",
                                     "#0072B2", "#D55E00", "#CC79A7"))) +
  scale_fill_manual(values = alpha(c("#E69F00", "#56B4E9", "#009E73",
                                   "#0072B2", "#D55E00", "#CC79A7"), 1))

I’m running brms 2.13.3 on MacOS Catalina

Any hints are welcome
Thanks!
Elisa

1 Like

I’m not 100% sure, but if you change this

to this

plot(ce, line_args = list(alpha=0.8))

does that work?

It does work! Thank you

1 Like