strengejacke / sjPlot

sjPlot - Data Visualization for Statistics in Social Science
https://strengejacke.github.io/sjPlot
608 stars 91 forks source link

GGplot functions do not work with plot_model only for type = "pred" #740

Open Dotfalco opened 3 years ago

Dotfalco commented 3 years ago

So when I do this command:

plot_model(m2, type = "pred", terms = c("trial_s [all]", "lambda [0, .25, .5]", "beta [2, 5, 8]", "expcond"), colors = c("#3182bd", "#c51b8a", "#5ab4ac"), title = "NEW") Error in p + ggtitle(title) : non-numeric argument to binary operator

but if I modify it to:

plot_model(m2, type = "eff", terms = c("trial_s [all]", "lambda [0, .25, .5]", "beta [2, 5, 8]", "expcond"), colors = c("#3182bd", "#c51b8a", "#5ab4ac"), title = "NEW")

I get no errors and the title becomes "NEW". I also have other lab members that don't have any issues with the "pred" type and can make modifications.

Here is my Version (but I also tried this on 3.6.1 with no success):

version _
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 4
minor 0.4
year 2021
month 02
day 15
svn rev 80002
language R
version.string R version 4.0.4 (2021-02-15) nickname Lost Library Book

strengejacke commented 3 years ago

If you have four "terms", plots are arranged using gridExtra::grid.arrange(), which is no longer a ggplot2 object.

JanaJarecki commented 3 years ago

Hi, would it be possible to arrange the plots via patchwork https://patchwork.data-imaginist.com/ this might allow more flexibility https://patchwork.data-imaginist.com/articles/guides/assembly.html#modifying-patches-1