我想将绘图的图像保存为 png 文件;但是它切断了轴标签。所以我尝试通过设置“omi”和“mar”来留出更大的余量,但它似乎不起作用。添加更多像素也不起作用。cex.lab 的较小值会使轴可见但小得难以阅读。
可能这个错误很愚蠢,但我无法弄清楚......
png(filename = "CarTheftForeigners.png",
width = 1120, height = 646, units = "px", pointsize = 12,
bg = "white", res = NA, family = "", restoreConsole = TRUE,
type = c("windows", "cairo", "cairo-png")
)
plot(Table$Car.Theft,Table$Foreigners,
type="p", pch=20, col="red",
main="Correlation of the Rate of Car Theft and Rate of Foreigners", cex.main=2,
xlab="Rate of Car Thefts",
ylab="Rate of Foreigners", cex.lab=2,
par(omi=c(1,1,1,1)+0.1))
abline(reg=lm(Foreigners ~ Car.Theft, data=Table),col="blue")
dev.off()
无论我为 omi 或 mar 添加什么值,我总是会收到错误消息:
Fehler in plot.window(...) : ungültiger 'xlim' Wert
这是德语,意味着 xlim-value 无效。
感谢您的帮助!