简体   繁体   中英

sjPlot - plot_model() change points color and lines [R]

I have a lmer model and want to plot the effect trend with the point data, but the function plot_model(), although is great at plotting what I want, seems very unflexible in terms of customization.

I want to change the colours and alpha of the points in the following plot:

model1<-lmer(NDVI~ fall_ai+spring_ai+SI+(1|colony),data=clm,REML=T)
plot_model(model1, type = "pred", show.data = T)

在此处输入图片说明 As well as change the CI lines from alpha colour to dashed lines, like the example below:

在此处输入图片说明 How can I do it?

A workaround can be using lattice to do it:

plot(Effect(c("fall_ai"),model1),
     colors="black",lwd=1.5,ylab="Spring NDVI",xlab="Autumn Aridity Index",
     ci.style="lines",main="",ylim=c(0.20,0.55),xlim=c(0,45))

trellis.focus("panel", 1, 1, highlight = FALSE)
print(panel.points(clm$fall_ai,pch = 16, cex = 0.7, col = "black"))
trellis.unfocus()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM