3

Following on the question on vcd in R by rnso (How to change color palette of mosaic plot)

I would like to ask what I am doing wrong when trying to adjust the cut-off levels in a shading-max mosaic?

library(vcd)

mat <- matrix(c(120,230,84,70,130,83,13,26,18),3)
dimnames(mat) <- list(c("good","fair","poor"),c("a","b","c"))
mat

set.seed(403)
mosaic(mat, gp = shading_max)

This works fine so far but when trying to modify the (1-alpha) levels nothing happens. It looks the same as when using the default levels (0.9 and 0.99). For example,

set.seed(403)
mosaic(mat, gp = shading_max, level = c(0.6, 0.99), n = 1000)
zx8754
  • 52,746
  • 12
  • 114
  • 209

1 Answers1

2

Use gp_args: a list of arguments for the shading-generating function.

mosaic(mat, gp = shading_max, 
   gp_args = list(level = c(0.6, 0.99), n = 1000))

enter image description here

Marco Sandri
  • 23,289
  • 7
  • 54
  • 58