Unified recordGraphics#437
Conversation
- Don't know why the latter doesn't work for testing anymore (it's fine for interactive use)
|
Just to add: I know the diff makes it look like I changed all of recordGraphics(
{
...
},
...
)There's very little changed in terms of the actual code logic or lines of code. We just wrap more steps in the recording brace. |
|
Thanks, this is great! I've played around with a couple of examples which all work nicely now. |
|
Ugh Everything was looking great, but I've just tested a local website build and it looks like this reintroduces a similar problem to the one that was solved by @vincentarelbundock in #425. Specifically, we only get one rendered plot for every example page on the website. It doesn't appear to be theme specific, since every help documentation page is affected (here: using Running these same Examples manually one at a time seems to work fine... But copying the full examples code chunk and running en masse leads to a similar problem... we get multiple copies of the same, final graph. I'd have to do more digging to figure this out. But please feel free to test and jump in with suggestions if you any. |
|
Update: This appears to be a recurrence of #388 (resolved in #394). What's really odd (annoying) is that the problem is not consistent across IDEs or runtimes.
Obviously, calling |
|
I played around with your Instead of doing the |
|
Thanks Achim. Fingers crossed I've found a simpler workaround. Will test
after dinner.
|
|
Closing in favour of #438. |
|
Thanks for this fix, and all of your hard work. My original example, and some of the ones I tried from these threads, all worked perfectly, great! |

Fixes #313
Fixes posit-dev/positron#7316
This PR wraps all of the tinyplot drawing logic in a single, unified
recordGraphics({...})call and thereby resolves the layering + resizing issues that we have been running into for faceted plots, as well as some related problems specific to the Positron IDE. The code is a little (tiny?) bit uglier, but that's a trade-off I'm happy to make if we can avoid unexpected plotting errors when adding layers.(Previously, we had separate
recordGraphics()logic for thedraw_legendanddraw_facet_windowstages, but something was obviously falling through the cracks that was leading to misalignment of added layers.)My screen (video) recorder isn't working for some reason, but here's a simple screenshot of a correctly aligned layers from a Positron session.
Please give this a quick test drive when you get a sec @zeileis, @vincentarelbundock and/or @jhpantel. Thanks!