ProjectMOSAIC / mosaic

Project MOSAIC R package
http://mosaic-web.org/
93 stars 26 forks source link

color choices in xpnorm() and related functions #717

Closed nicholasjhorton closed 6 years ago

nicholasjhorton commented 6 years ago

library(mosaic) xpnorm(1.96)

Is this a good choice in terms of color blindness?

screen shot 2018-08-07 at 8 38 19 am

screen shot 2018-08-07 at 8 39 50 am

rpruim commented 6 years ago

Looks like we are using

      gf_refine(
        scale_fill_brewer(type = "qual", palette = 6),
        scale_color_brewer(type = "qual", palette = 6)
      )

and

      gf_refine(
        scale_fill_brewer(type = "qual", palette = 2),
        scale_color_brewer(type = "qual", palette = 2)
      )

We could swap those out. Do you have a suggested replacement? We could use a different color brewer palette or switch to viridis.

rpruim commented 6 years ago

Here's what it looks like using viridis:

library(mosaic)
xpnorm(c(1, 1.96)) 
#> 
#> If X ~ N(0, 1), then
#>  P(X <= 1.00) = P(Z <= 1.00) = 0.8413    P(X <= 1.96) = P(Z <= 1.96) = 0.9750
#>  P(X >  1.00) = P(Z >  1.00) = 0.1587    P(X >  1.96) = P(Z >  1.96) = 0.0250
#> 

#> [1] 0.8413447 0.9750021
xpnorm(1.96) 
#> 
#> If X ~ N(0, 1), then
#>  P(X <= 1.96) = P(Z <= 1.96) = 0.975
#>  P(X >  1.96) = P(Z >  1.96) = 0.025
#> 

#> [1] 0.9750021
xqchisq(c(0.5, 0.8), df = 4)

#> [1] 3.356694 5.988617

Created on 2018-08-07 by the reprex package (v0.2.0).

rpruim commented 6 years ago

image