modelbased icon indicating copy to clipboard operation
modelbased copied to clipboard

`visualization_recipe()` for `estimate_slopes()` should not map alpha to discrete values

Open strengejacke opened this issue 2 years ago • 5 comments

Related to https://github.com/easystats/see/pull/310 visualization_recipe() adds the alpha-aes, but it's mapped to a discrete scale, which yields a warning (and thus, some tests fail for see).

model <- lm(Petal.Length ~ Species * poly(Sepal.Width, 3), data = iris)
result <- modelbased::estimate_slopes(model, at = c("Sepal.Width", "Species"))
#> No numeric variable was specified for slope estimation. Selecting `trend = "Sepal.Width"`.
plot(result)
#> Warning: Using alpha for a discrete variable is not advised.

Created on 2023-10-12 with reprex v2.0.2

strengejacke avatar Oct 12 '23 20:10 strengejacke

In general, we should avoid using alpha as an aesthetic. linetype would be better here

bwiernik avatar Oct 13 '23 13:10 bwiernik

In this specific case, I like having the significant chunks on alpha... Is there a way to avoid the warning?

DominiqueMakowski avatar Oct 13 '23 14:10 DominiqueMakowski

I really strongly think we should not map things to alpha. It is very inaccessible. We should use color, linewidth, or linetype instead

When I was teaching, students almost always assumed that something was broken or wrong when they got a plot using alpha mapping — it’s not an aesthetic people expect to see in the situations where we use it

bwiernik avatar Oct 14 '23 01:10 bwiernik

I supposed the alternative would be dashed for non-sig and solid for sig whaddayathink?

DominiqueMakowski avatar Oct 14 '23 10:10 DominiqueMakowski

I would like that a lot

bwiernik avatar Oct 14 '23 14:10 bwiernik