[R] wmf screen resolution problem!!!
Venkat Karthik
tvkarthik05 at gmail.com
Sat Dec 7 13:46:50 CET 2013
Dear colleagues,
For the past two weeks we have been struggling to create a proper image
with stable pixels, height & width from R for various screen resolutions.
We are trying to generate a wmf image with fixed pixels, fixed height &
fixed width. But the problem we are facing is that when the same code is
run on a different screen resolution the dimensions of the image are no
longer the same.
We would like to generate an image with height=16.6 cm and width=25 cm.
Example code:
##Width & height in inches
height <- 6.53
width <- 9.84
h <- height + (height*0.128) #Correcting the height so that when inserted
into word doc height in the Original size is 16.6cm
w <- width + (width*0.0570) #Correcting the width so that when inserted
into word doc width in the Original size is 25cm
win.metafile("path to save\\test.wmf", height=h, width=w, restoreConsole =
TRUE)
boxplot(1:100)
dev.off()
When this image is generated on a screen resolution
*1280x1024* ==> height =16.6cm ; width=25cm ; pixels=999x708
*1920x1080 *==> height =15.73cm ; width=16.6cm ; pixels=999x708
Is it possible to keep all the 3 things fixed across different screen
resolutions?
Please find attached the images generated in the 2 resolutions.
It would be of great help if anyone could suggest what could be done.
Thanks in advance!!!
Regards,
Karthik
More information about the R-help
mailing list