[Rd] Bug report: saving plot as wmf file - extra white space

Francis Burton Francis.Burton at glasgow.ac.uk
Tue Aug 22 13:14:05 CEST 2017


Saving a plot to Windows metafile (wmf) now includes additional unwanted space to the right of and below the plot.

The bug can be reproduced with the following code:

win.metafile("test.wmf")
plot(c(1,4,2,3))
dev.off()

# png output for comparison
png("test.png")
plot(c(1,4,2,3))
dev.off()

I expected the blank space around the plot in the wmf file to be minimal, and comparable to that in the equivalent png file. This means such wmf files cannot e.g. be programmatically inserted into PowerPoint slides because the extra white space causes problems by covering other elements. They would have to be cropped first.

It works as expected on

Windows 7
platform       x86_64-w64-mingw32          
version.string R version 3.4.0 (2017-04-21)

but not on

Windows 10
platform       x86_64-w64-mingw32          
version.string R version 3.4.1 (2017-06-30)

I don't know if this problem is related to R version issue or is a Windows 7/10 issue.

Francis



More information about the R-devel mailing list