Skip to content
Prev 75096 / 398502 Next

High resolution plots

Knut Krueger schrieb:
There are three bmp based functions available;:
bmp, jpeg, png

bmp is without compression so I decided not to use it 
jpeg is no loss less compression so I decided not to use it 
the third was png

Now I tried the other one and I think that there is a bug in the png code or I do not understand the reason:

jpeg(filename = "c:/r/Rplot%03d.jpg", width = 960, height = 960, pointsize = 24, quality = 100, bg = "white", res = 2400)
witdh/heigth  = 960  <> 10.16 mm
ppi=2400
Results as expected


jpeg(filename = "c:/r/Rplot%03d.jpg", width = 1920, height = 1920,
          pointsize = 48, quality = 100, bg = "white", res = 2400)

witdh/heigth  = 1920  <> 20.32 mm
ppi=2400
Results as expected


bmp(filename = "c:/r/Rplot%03d.bmp", width = 1920, height = 1920, pointsize = 48, bg = "white", res = 2400)
witdh/heigth  = 1920  <> 20.32 mm
ppi=2400
Results as expected


png(filename = "c:/r/Rplot%03d.png", width = 1920, height = 1920, pointsize = 48, bg = "white", res = 2400)

witdh/heigth  = 1920  <> 20.32 mm
ppi=150
Result not as expected.

Ok I am able to use the jpeg or bmp format, but does anybody know why the png function does not work in the same way as the jpeg and bmp function?

Regards Knut