首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >qcc (质量控制图)图在R中的灰色背景

qcc (质量控制图)图在R中的灰色背景
EN

Stack Overflow用户
提问于 2016-01-20 20:17:45
回答 1查看 937关注 0票数 2

我遇到了一个问题,我的图形总是在浅灰背景上,在LaTeX中看起来很糟糕。我试过用par(bg=NA)par(bg="white") --这是每个人都建议的--但实际上什么也做不了.

下面是代码:

代码语言:javascript
复制
# 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) 
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-01-20 20:50:48

查看?qcc.options() --特别是bg.margin选项。下面将更改您的lightgreen背景(注意:对于LaTeX来说可能不是一个好的选择,但它说明了这一点):

代码语言:javascript
复制
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)

old <- qcc.options()  # save the original options
qcc.options(bg.margin = "lightgreen")
par(mar = c(5, 3, 1, 3))
control <- qcc(nonconforming, type = "p", samplesize, plot = "FALSE")
warn.limits <- limits.p(control$center, control$std.dev, control$sizes, 2)
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)
qcc.options(old)  # reset the old options 

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34909668

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档