【发布时间】:2021-06-03 06:20:50
【问题描述】:
我想改进使用 sjPlot 包制作的绘图。
我对此只有两个担心,第一个是线条看起来有点像素化(主要是红色和绿色的线条),我想改进它,我尝试了一些方法,但都不可能。
此链接中的数据集: https://docs.google.com/spreadsheets/d/1nXerN91Iehe9OM1VGDMS3jnbvvF1tWcuS9bGtlrj_Ss/edit?usp=sharing
# Please copy the dataset from the link before following the code
library(ggplot2)
library(sjPlot)
library(ggeffects)
dat <- read.delim("clipboard", dec=","); attach(dat)
dat$Id <- as.integer(factor(dat$Esp))
str(dat)
m5 <- geeglm(
formula = tim ~ Pa*Pt,
family = Gamma(link = log),
data = dat,
id = Id,
corstr = "exchangeable"
)
anova(m5,test="chisq")
p= plot_model(m5, type = "pred", terms = c("Pt[n=100]", "Pa"),
digits=1,line.size=0.5,show.data=T,colors=c("green","#00a0c9","red"))
p
第二个是我想删除十进制值(即 x 轴上的 1.5 和 2.5),但是我不太确定是否可以在 sjPlot 中执行此操作,或者您是否知道类似的替代方法在ggplot2中。我尝试了这种方法,但没有奏效。
p+ scale_x_discrete(limits=c(1,2,3))
在制作这个情节时,我想在 1 之前和 3 之后有一个空格。
非常感谢您提供的任何帮助!
【问题讨论】: