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

Fixes for replaying plots #40

Merged
merged 2 commits into from Aug 6, 2020
Merged

Fixes for replaying plots #40

merged 2 commits into from Aug 6, 2020

Conversation

@cpsievert
Copy link
Contributor

@cpsievert cpsievert commented Aug 4, 2020

Closes #39.

653640c seems sufficient for fixing the issue for grid graphics, but 13e252c also seems necessary to fix the issue for base graphics (I'm not entirely sure why the timing matters). Here's a minimal base example:

library(showtext)
font_add_google("Lobster", "lobster")
showtext_auto()
png("foo.png")
dev.control(displaylist = "enable")
plot(1, pch = 16, cex = 3)
text(1, 1.1, "A fancy dot", family = "lobster", col = "steelblue", cex = 3)
result <- recordPlot()
dev.off()
file.show("foo.png")

png("foo2.png")
replayPlot(result)
dev.off()
file.show("foo2.png")
cpsievert added 2 commits Aug 4, 2020
I'm not entirely sure why, but this timing apparently matters when replaying base graphics
@yixuan
Copy link
Owner

@yixuan yixuan commented Aug 5, 2020

Thank you @cpsievert for your effort! Let me take a look at the code and see what to do next. I'll get you back soon.

@yixuan yixuan merged commit f92ddd1 into yixuan:master Aug 6, 2020
@yixuan
Copy link
Owner

@yixuan yixuan commented Aug 6, 2020

This patch looks great! I'll submit a new version in the next few days.

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

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.