如何提高 sjPlot

问题描述

我想改进使用 sjPlot 包制作的绘图。

绘制下面的代码时,生成的图如下所示

enter image description here

我对此有两个顾虑,第一个是线条看起来有点像素化(主要是红色和绿色线条),我想改进它,我尝试了一些方法,但没有实现。

此链接中的数据集: 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 之后有一个空格我想删除。

enter image description here

非常感谢您提供的任何帮助!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)