Closed pdwaggoner closed 5 years ago
Hi, I'm pretty sure scale_colour_grey this does the trick. If you're using RStudio and it looks weird in the plots viewer, click the zoom button and look at it that way to check.
library(tidyverse)
data(immigration)
# specify formula
f1 <- ChosenImmigrant ~ Gender + Education + LanguageSkills + CountryOfOrigin + Job + JobExperience + JobPlans + ReasonForApplication +
PriorEntry
# create plot object
p <- plot(mm(immigration, f1, id = ~CaseID), vline = 0.5)
# adjust visuals
p +
scale_colour_grey() +
theme_bw()
theme(legend.position = "right")
The last two lines aren't necessary, but I think it looks better with them. That is, p + scale_colour_grey()
should be fine on its own. Equally you can do it without saving the plot object of course:
library(tidyverse)
data(immigration)
# specify formula
f1 <- ChosenImmigrant ~ Gender + Education + LanguageSkills + CountryOfOrigin + Job + JobExperience + JobPlans + ReasonForApplication +
PriorEntry
# calculate mms
mm_immigration <- mm(immigration, f1, id = ~CaseID)
# create plot object
plot(mm_immigration, vline = 0.5) +
scale_colour_grey()
Exactly. It’s a ggplot2 object so you can just + whatever further modifications you want to it. You may need to use an aes() if you want to change shape, fill, etc. rather than colour.
Brilliant - many thanks for the help here! And many thanks @leeper for the great package; super useful and simple to use.
Please specify whether your issue is about:
See below for these things. I just copied and pasted the example for MM's from the package README.
I was curious if you could change the colors to gray scale, for example, instead of rainbow colors for journal publication? Couldn't figure out how to do this. Thanks!
Example here: