-
Notifications
You must be signed in to change notification settings - Fork 7
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
Par restore #13
Par restore #13
Conversation
@vincentarelbundock I can't get these tinysnapshot tests to pass on GitHub's CI even though I generated them locally using Ubuntu 22.04 on a Rocker image. (As mentioned before, my default Arch system generates slight differences in fonts that also triggers errors.) I can switch to MacOS, which I have on my work machine. But I'm wondering what the best long-term solution, is given that you and (I think?) @zeileis are on Ubuntu. Any thoughts? |
Just fyi: I'm on Debian testing. Not much I can contribute off the top of my head otherwise. Just maybe that there is the gdiff package from Paul Murrell. I've never worked with it, though. |
@zeileis @grantmcdermott I added a new argument to
The snapshots were re-generated on my computer, and they match the Ubuntu from Github actions. Now I need to figure out if this will work on your local install. |
Great, thanks for taking a look. I'm a bit pushed for time this morning. So let me merge this in a bid for expediency and then I'll test with Liberation when I get a chance later. |
Tested quickly and good news: explicitly requiring Liberation fonts fixes the problem (and on my native Arch system too). Huzzah! |
Thanks, Vincent @vincentarelbundock, I didn't realize that Will try to use it for our |
@zeileis Yeah, this is a very very new package. So fair warning: there may (will?) be some rough corners. But I'm always eager to get feedback from early adopters! Just make sure you read this section of the README on "deterministic" plots, and maybe wait a few days for version 0.0.3 to come out. |
Fixes #6 by adding a
par_restore
argument.Defaults to
par_restore = FALSE
, in which case any changes topar
during aplot2()
call (e.g., from a legend repositioning) will persist afterwards. I initially resisted persisting changes as a default, but in hindsight I think this is more consistent with the normal base plot workflow. (And, in the case of #6, means that we can add elements after a plot is drawn in the regular manner.) Ofc users can opt out of this behaviour by switching topar_restore=TRUE
.Examples:
Created on 2023-04-09 with reprex v2.0.2