0

I'm trying to export a ggplot to word as an windows metafile on windows platform. Some suggest cairo to remove aliasing, but I need to save the plot as windows metafile, which don't work with wmf. ggsave(plot=plot,filename="plot.wmf",type="cairo")

gives

Error in grDevices::win.metafile(...) : unused argument (type = "cairo")

Do anyone have a solution?

jap
  • 1
  • 2

1 Answers1

-1

Take a look at the ggsave documentation as it appears you're missing an argument. Looks like you need both a plot and a filename, and the cairo type isn't specified.

From what you have: ggsave(plot.wmf,type="cairo")

To something like: ggsave(plot = plot.wmf, "plot.wmf", type ="cairo-wmf")

More help from this resource: https://gist.github.com/dsparks/3777731

Brody
  • 24
  • 3
  • Sorry, I was sloppy when typing the question. I have assigned the ggsave to a existing plot as you mentioned (see updated question). The problem is that cairo-wmf doesn't exist(?) and don't work. Same error occur. – jap Oct 26 '20 at 12:21