Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ggsave error with emf and wmf "grDevices::win.metafile(...) : unused argument (bg = "white")" #4521

Closed
dweis-ku opened this issue Jun 17, 2021 · 4 comments · Fixed by #4523
Closed

Comments

@dweis-ku
Copy link

dweis-ku commented Jun 17, 2021

ggsave produces error when saving in wmf or emf format
Error in grDevices::win.metafile(...) : unused argument (bg = "white")

Save as PDF and PNG work as expected.

reprex:

library(tidyverse)
e <- ggplot(mpg, aes(cty, hwy))
e + geom_point()
ggsave("test.wmf")
ggsave("test.emf")

Expected that my plot would save.

@dweis-ku
Copy link
Author

Further troubleshooting:
The following code generates a wmf file successfully:

library(tidyverse)
e <- ggplot(mpg, aes(cty, hwy))
e <- e + geom_point()
win.metafile("test.wmf")
print(e)
dev.off()

@yutannihilation
Copy link
Member

I don't have Windows machine right now, but it seems this is caused by the change of #4164.

@dweis-ku
Copy link
Author

dweis-ku commented Jul 1, 2021

resolved in ggplot 3.3.5

@dweis-ku dweis-ku closed this as completed Jul 1, 2021
@yutannihilation
Copy link
Member

Thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants