From Francis.Burton at glasgow.ac.uk  Tue Aug 22 13:14:05 2017
From: Francis.Burton at glasgow.ac.uk (Francis Burton)
Date: Tue, 22 Aug 2017 11:14:05 +0000
Subject: [Rd] Bug report: saving plot as wmf file - extra white space
Message-ID: <82E404174906234C8959023CCB3DD5410FCAE582@CMS12-01.campus.gla.ac.uk>

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



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