14.3 Outputting to WMF Vector Files

14.3.1 Problem

You want to create a Windows metafile (WMF) image of your plot.

14.3.2 Solution

WMF files can be created and used in much the same way as PDF files – but they can only be created on Windows:

win.metafile("myplot.wmf", width = 4, height = 4)

# With ggsave()
ggsave("myplot.wmf", width = 8, height = 8, units = "cm")

14.3.3 Discussion

Windows programs such as Microsoft Word and PowerPoint have poor support for importing PDF files, but they natively support WMF. One drawback is that WMF files do not support transparency (alpha).