mice
mice copied to clipboard
Is it possible to scale the x-axis in an md.pattern() plot.
I have been able to rotate the label names, but would like to scale the x axis to make the numbers readable. Does anyone know if this is possible?
mice 3.3.5
adds the rotate.names
argument to md.pattern()
Originally posted by @stefvanbuuren in https://github.com/amices/mice/issues/154#issuecomment-453842762
Not a solution, but to circumvent the problem you could use the ggplot code that I've written for a shiny app here: https://github.com/amices/shinyMice/blob/main/shinymice/R/utils_02_model.R
How did you rotate the x-axis values? I would also like to do that.
@woodwards The visualization package ggmice
now offers easily adjustable md pattern plots. You could use it from CRAN or look at the source code in this repo?
@woodwards I am pretty sure you can try. md.pattern(x, plot = TRUE, rotate.names = TRUE)
, however as @hanneoberman said the ggmice
package might also be suitable.
I am using rotate.names, but it only rotated the names on top of the plot, not the numbers on the bottom.
@woodwards-dnz For this you should use ggmice
as suggested by @hanneoberman. Please find the vignette here for reference.
You can use the plot pattern function and specify rotate as true.
plot_pattern(dat, square = TRUE, rotate = TRUE)
Suggest using ggmice::plot_pattern()
as a solution, so am closing.