Skip to content

Conversation

grantmcdermott
Copy link
Owner

@grantmcdermott grantmcdermott commented Sep 16, 2025

Fixes #474

I tracked the issue down to the fact the draw_facet_window (here) is actually being called twice and, during the second time, it's dropping the tpar hooks.

While I'm not 100% certain of the mechanics, I'm pretty confident that this is another recordGraphics / replayGraphics gotcha. (Side note: I think this only appears to affect "dynmar" among all of the sundry tpar parameters, because the rest are handled by native hooks that kick in once plot.new() is called.)

At any rate, the simple solution that I use here is just to pass dynmar as an explicit argument in recordGraphics(draw_facet_window, list(..., dynmar = get_par("dynmar")). I thought about passing the whole tpar() list as an argument, since we actually extract other tpar parameters as part of the same function, but erred on the conservative side since only dynmar appears to be affected.

@grantmcdermott grantmcdermott merged commit 8d331f3 into main Sep 16, 2025
3 checks passed
@grantmcdermott grantmcdermott deleted the dynmar-pass branch September 16, 2025 05:59
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 this pull request may close these issues.

Reseting tinytheme() in sourced script yields LHS margin errors for _preceding_ plots
1 participant