将绘图保存为 EMF 文件 [英] Saving plots as EMF files
问题描述
我在使用 devEMF
包中的 emf()
函数时遇到问题.
I am having an issue with the emf()
function from the devEMF
package.
我使用的代码 -
library(devEMF)
emf(file = "trial.emf")
plot(1:10, seq(10, 100, 10), type = "l", xlab = "Time", ylab = "Distance")
#sample plot
dev.off()
这没有情节线,但有其他所有内容(标签、轴刻度、标题).
This does not have the plot line but does have everything else (labels, axis ticks, title).
我是否缺少一些图形包?
Am I missing some graphics package?
sessionInfo()
#R version 3.3.2 (2016-10-31)
#Platform: x86_64-w64-mingw32/x64 (64-bit)
#Running under: Windows 7 x64 (build 7601) Service Pack 1
#locale:
#[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United #
#States.1252
#[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
#[5] LC_TIME=English_United States.1252
#attached base packages:
#[1] stats graphics grDevices utils datasets methods base
#other attached packages:
#[1] devEMF_3.6
#loaded via a namespace (and not attached):
#[1] tools_3.3.2
推荐答案
如果您尝试在 LibreOffice 之外查看,该函数中的某些默认值并不理想.
Some of the defaults in that function are not ideal if you are trying to view outside of LibreOffice.
试试这个:
library(devEMF)
emf(file = "trial.emf", emfPlus = FALSE)
plot(1:10, seq(10, 100, 10), type = "l", xlab = "Time", ylab = "Distance")
dev.off()
确保 emfPlus = FALSE
.如果您在 LibreOffice 中查看 emfPlus = TRUE
生成的图,您会发现它看起来不错.与其他查看器一起工作时使用 emfPlus = FALSE
.
Make sure that emfPlus = FALSE
. If you view the plot generated by emfPlus = TRUE
in LibreOffice you will see it looks fine. Use emfPlus = FALSE
when working with other viewers.
这篇关于将绘图保存为 EMF 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!