geom_raster
kullanan bir ggplot kaydederken, döşemeler "lekeli" çıkıyor. ggsave()
veya pdf()
'u kullanırsam aynı sonuçtur. Bu sorun geom_tile
veya image
ile yok. RStudio, X11 veya PNG grafik aygıtlarında bu sorun yok.geom_raster, PDF'ye kaydederken "bulaşmış" çıkıyor
Buna neden olan nedir? Bunu nasıl düzeltebilirim?
Örnekler:
library(ggplot2)
## doesn't work: tiles are smeared together
ggsave("smeared1.pdf",
ggplot(cbind(expand.grid(x = 1:3, y = 1:3), fill = rnorm(9))) +
geom_raster(aes(x = x, y = y, fill = fill)))
pdf("smeared2.pdf")
ggplot(cbind(expand.grid(x = 1:3, y = 1:3), fill = rnorm(9))) +
geom_raster(aes(x = x, y = y, fill = fill))
dev.off()
## works fine
ggsave("not-smeared0.png",
ggplot(cbind(expand.grid(x = 1:3, y = 1:3), fill = rnorm(9))) +
geom_raster(aes(x = x, y = y, fill = fill)))
ggsave("not-smeared1.pdf",
ggplot(cbind(expand.grid(x = 1:3, y = 1:3), fill = rnorm(9))) +
geom_tile(aes(x = x, y = y, fill = fill)))
pdf("not-smeared2.pdf")
ggplot(cbind(expand.grid(x = 1:3, y = 1:3), fill = rnorm(9))) +
geom_tile(aes(x = x, y = y, fill = fill)))
dev.off()
pdf("not-smeared3.pdf")
image(matrix(rnorm(9), 3))
dev.off()
Belki bir ekran görüntüsü gönderebilir ya da iki yüzden kolayca Ne demek istediğini anlıyorum ki? – Gregor