我正在尝试创建一个TukeyHSD事后测试图的pdf(通过Sweave,但我也尝试pdf()
,产生相同的结果)。虽然文档查看器(Ubuntu 10.04)和Acrobat Reader无法正确显示图表,但Foxit阅读器没有问题。
Acrobat Reader显示错误,无法显示图像,DV打印此“......”(它应该有水平置信区间条和垂直虚线)。
仅在TukeyHSD事后测试图中发生这种情况,所有其他图形打印得很好(在R的绘图设备中打印得很好)。有没有人经历过这个或类似的东西?我有什么其他选择?
答案 0 :(得分:1)
同样的事情发生在Mac上。预览会正确显示它,但Acrobat Reader在带有标签的正确绘制框内没有任何片段。尝试在调用中添加col =“black参数失败,但您可以通过在绘制调用的段中重新定义plot.TukeyHSD并使用col =”black“来消除此行为:
plot.TukeyHSD2 <- function (x, ...) {
for (i in seq_along(x)) {
xi <- x[[i]][, -4, drop = FALSE]
yvals <- nrow(xi):1
plot(c(xi[, "lwr"], xi[, "upr"]), rep.int(yvals, 2),
type = "n", axes = FALSE, xlab = "", ylab = "", ...)
axis(1, ...)
axis(2, at = nrow(xi):1, labels = dimnames(xi)[[1L]],
srt = 0, ...)
abline(h = yvals, lty = 1, lwd = 1, col = "lightgray")
abline(v = 0, lty = 2, lwd = 1, ...)
segments(xi[, "lwr"], yvals, xi[, "upr"], yvals, col="black", ...)
segments(as.vector(xi), rep.int(yvals - 0.1, 3), as.vector(xi),
rep.int(yvals + 0.1, 3), col="black", ...)
title(main = paste(format(100 * attr(x, "conf.level"),
2), "% family-wise confidence level\n", sep = ""),
xlab = paste("Differences in mean levels of", names(x)[i]))
box()
}
}