fsolt / dotwhisker

Dot-and-Whisker Plots of Regression Results
https://fsolt.org/dotwhisker/
Other
57 stars 10 forks source link

Make theme for black-and-white plots #71

Closed stefan-mueller closed 6 years ago

stefan-mueller commented 6 years ago

I was thinking whether we might add an option to create a black-and-white plots. I know that it's possible to adjust it with theme_, but this can be a bit tedious. A simple example:

library(dotwhisker)

m1 <- lm(mpg ~ wt + cyl + disp + gear, data = mtcars)

# draw a dot-and-whisker plot
dwplot(m1)

# apply theme_bw() from ggplot2
dwplot(m1) + 
  theme_bw()

For the second plot, the bar colours are in still red, and the legend "model" is added although we have only one model.

I was thinking about adding an option called, for example, theme = "bw", which takes care of this. By default in this theme, we could

Adjustments could still be made by adding/overwriting the default of theme = "bw"by using ggplot2 options.

Basically, these plots would look similar to the black and white ones from the vignette.

What are your thoughts on this? Feedback welcome. I'm happy to work on this.

stefan-mueller commented 6 years ago

78 pretty much solves this feature request, so I close this issue. Thanks for the recent improvements by the way, @fsolt!

fsolt commented 6 years ago

Getting rid of cowplot (which I did to close #78) means the default dotwhisker plot isn't black-and-white anymore, so I guess this one should be reopened. The "disable the legend when we plot only one model" bullet was included at some point, but the rest remains.

My feeling about this, tbh, is that theme formatting such as this should probably remain out of the package if it can be accomplished via ggplot2 calls after the dotwhisker plot is made (that's true here, right?), but I'm open to arguments to the contrary . . .

stefan-mueller commented 6 years ago

I agree, we can close this issue. Users can simply use ggplot2 options to customise the theme (as we show in the vignette).