【发布时间】:2025-12-29 05:25:06
【问题描述】:
所以这里有些奇怪,至少对我来说是这样。当我使用 HH 的 export.eps 方法中的 export.eps 生成 eps 文件,然后使用 epstopdf 转换它时,.pdf 文件的背景颜色会发生变化!但它只发生在用 ggplot2 制作的情节上!例如:
library(ggplot2)
library(HH) # export.eps
qplot(rating, data=movies, weight=votes, geom="histogram") + theme_bw()
export.eps("result.eps")
但是当我使用 epstopdf result.eps 将 result.eps 转换为 result.pdf 时,result.pdf 上会出现一个奇怪的蓝色背景:
当我使用plot 函数时不会发生这种情况:
plot(6:25,rnorm(20),type="b",xlim=c(1,30),ylim=c(-2.5,2.5),col=2)
export.eps("result_ok.eps")
这里我使用epstopdf result_i.eps,但 result_i.pdf 有白色背景:
由于我在两者上都使用export.eps,我认为这与 ggplot2 如何组成图像有关,但作为 R 中的菜鸟,我不知道如何解决它。
【问题讨论】: