无法打印到 pdf ggplot 图表 [英] Can't print to pdf ggplot charts

查看:28
本文介绍了无法打印到 pdf ggplot 图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复:
从 R 函数内生成多个图形

发生在我身上的非常奇怪的事情:以下代码无法打印到 pdf 设备:

Very strange thing happening to me: the following code fails to print to pdf device:

outnames <- c("1.pdf", "2.pdf")
for (n in outnames){
    pdf(n)
    qplot(1:10)
    dev.off()
}

不会将任何内容打印为 pdf,即使生成了 pdf 文件.然而,

won't print anything to pdf, even though a pdf file is generated. However,

pdf(outnames[2])
qplot(1:10)
dev.off()

将工作得很好.知道为什么吗?转载于 R 2.11.1.

will work perfectly well. Any idea why? Reproduced in R 2.11.1.

推荐答案

Gappy,闻起来像 FAQ 7.22 -- 所以请尝试print(qplot(1:10)).

Gappy, that smells like the FAQ 7.22 -- so please try print(qplot(1:10)).

这篇关于无法打印到 pdf ggplot 图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆