我遇到了一個問題,我的圖總是在淺灰色的背景上,在LaTeX中看起來很糟糕。我已經使用par(bg=NA)
,par(bg="white")
這是每個人都建議,但是,從字面上什麼都不做嘗試...當使用qcc(質量控制圖)時,R中的灰色背景陰謀
下面的代碼:
# install.packages('qcc')
library(qcc)
nonconforming <- c(3, 4, 6, 5, 2, 8, 9, 4, 2, 6, 4, 8, 0, 7, 20, 6, 1, 5, 7)
samplesize <- rep(50, 19)
control <- qcc(nonconforming, type = "p", samplesize, plot = "FALSE")
warn.limits <- limits.p(control$center, control$std.dev, control$sizes, 2)
par(mar = c(5, 3, 1, 3), bg = "blue")
plot(control, restore.par = FALSE, title = "P Chart for Medical Insurance Claims",
xlab = "Day", ylab = "Proportion Defective")
abline(h = warn.limits, lty = 3, col = "blue")
v2 <- c("LWL", "UWL") # the labels for warn.limits
mtext(side = 4, text = v2, at = warn.limits, col = "blue", las = 2)
請儘量提供代碼,自給自足用於複製(這裏它缺少數據) – HubertL
完成,謝謝你的回覆。 – CanofDrink