Displaying 1 result from an estimated 1 matches for "grtaphic".
Did you mean:
graphic
2008 Jan 31
1
png() and pdf() alignment problems
...n=27)
r <- sqrt(outer(x^2, y^2, "+"))
z <- cos(r^2)*exp(-r/6), col=gray((0:32)/32)
# example1
# standard device size
pdf("pdf_fit.pdf")
image(z)
dev.off()
png("png_fit.png", res = 96)
image(z)
dev.off()
# both files overlay with high precision
# as known from R grtaphics output
# see attached example example1.pdf
# example2
# custom device size
pdf("pdf.pdf", width = 8, height = 4)
image(z)
dev.off()
png("png.png", width = 8, height = 4, units = "in", res = 96)
image(z)
dev.off()
# png output is somewhat larger
# and aligning them i...