Skip to content

Don't create a new graphics device on exit in ggsave(). Closes #2363. #2758

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

Merged
merged 1 commit into from
Aug 7, 2018

Conversation

clauswilke
Copy link
Member

Don't create a new graphics device on exist in ggsave(). This should address the remaining issue in #2363 and likely also the issue observed in #2752.

@clauswilke clauswilke changed the title Don't create a new graphics device on exist in ggsave(). Closes #2363. Don't create a new graphics device on exit in ggsave(). Closes #2363. Jul 13, 2018
@hadley hadley requested a review from wch July 23, 2018 12:36
Copy link
Member

@wch wch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good to me!

@clauswilke clauswilke merged commit 4d2ca99 into tidyverse:master Aug 7, 2018
@clauswilke clauswilke deleted the issue-2363-ggsave branch August 7, 2018 23:20
@ghost
Copy link

ghost commented Aug 16, 2018

I am writing a package in R that reads some files and reports variable statistics as table and various charts.
since I upgraded to ggplot2 version 3.0.0 I encountered two problems and reported it here. I think it is related to this issue but I am not absolutely sure:

  1. ggsave() opens an inactive graphic device which is very confusing for the users.
  2. ggsave() creates an error if the package is run in parallel. the error is:

a forked child should not open a graphics device

none of the above occurs on ggplot2 version 2.2.1. and the problem is solved if I downgrade.
I've tested on R 3.4 and R 3.5.
could you help me figure these out?

@clauswilke
Copy link
Member Author

Can you please install the github version of ggplot2 and test whether this resolves the issues.

@ghost
Copy link

ghost commented Aug 16, 2018

I installed and both problems are solved.

packageVersion('ggplot2')
[1] ‘3.0.0.9000’

@lock
Copy link

lock bot commented Feb 12, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Feb 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants