我正在使用sjPlot的
当我选择可用的sjPlot主题之一(
我如何为我的绘图使用黑白或灰度主题,或手动设置线条颜色为黑白色调?
根据我在网上找到的sjPlot资源,应该有比我看到的更多的sjPlot主题可用,这很奇怪。此外,我读到
编辑:我正在使用R版本3.5.0和Rstudio版本1.1.383 谢谢!
plot_model()
绘制回归模型。我想将线条颜色从sjPlot主题(红色和蓝色线条)更改为黑白色调或灰度。然而,当我使用set_theme(theme_bw())
时,图形外观没有改变(根据我在输入函数时看到的下拉菜单,theme_bw
来自ggplot2)。当我选择可用的sjPlot主题之一(
theme_538
、theme_blank
、theme_sjplot
和theme_sjplot2
)时,图形外观会发生变化,它们都呈现出红色和蓝色的线条,但是更改了绘图背景,因此我认为我使用的函数是正确的。我如何为我的绘图使用黑白或灰度主题,或手动设置线条颜色为黑白色调?
library(ggplot2)
library(sjPlot)
library(sjmisc)
#set_theme(theme_bw()) # this does not change the plot appearance
set_theme(theme_538()) # this does change the plot background appearance
M <- glm(DV ~ IV1 + IV2 + IV3 + IV1*IV2*IV3, data = data5, family = quasibinomial("logit"))
p <- plot_model(M, type = "pred", terms = c("IV1", "IV2", "IV3 [-1,0,1]"), theme = theme_get())
p
根据我在网上找到的sjPlot资源,应该有比我看到的更多的sjPlot主题可用,这很奇怪。此外,我读到
set_theme()
函数应该与ggplot2主题一起使用,但这似乎在这里并不是这样。是否有任何想法是哪里出了问题?也许我忽略了一些非常简单的东西?编辑:我正在使用R版本3.5.0和Rstudio版本1.1.383 谢谢!
plot_model()
添加了一个linetype = c(1,2)
参数,但这并没有起作用。是否有一种方法可以手动调整线型? - MKS.bln