Closed strengejacke closed 2 months ago
Thanks for the report! I'm not too familiar with how VSCode displays plots; do you have any idea what graphics device is used to display plots interactively?
I'm not very familiar with the technical background, either. I know that you can use the httpgd-package to display plots in R (see also https://nx10.github.io/httpgd/articles/b01_vscode.html), and that's what I have installed, too.
This remains a grid bug, not a ggplot2 bug. Sadly it has proven quite elusive to figure out why it happens but it has to do with some invalidation of the plot state in interactive devices
Ok. I was just curious because I realized this error just recently, after the ggplot 3.5.0 release. This could be a coincidence, but my guess was some kind of interaction between grid and the latest ggplot might lead to this issue.
It only seems to occur when the plot-window is not yet created. Once we have the plot-pane open, this error doesn't seem to re-appear.
Here's a short video, not sure if this helps. But maybe this issue should be closed/transferred anyway?
https://github.com/tidyverse/ggplot2/assets/26301769/56087cd1-e8af-42f5-bc21-63924c5d299b
Thanks - I am going to close it since it is not something on the ggplot2 side. I know @pmur002 is aware of the issue so maybe this will eventually get fixed.
There can be many reasons why it started appearing with the latest release of ggplot2. I think the output from ggplot is by far the most complex grobs that gets rendered in R so it is a great stress-test of grid. Small changes may stress grid in new ways, even if ggplot2 is not doing anything wrong
I recently had some issues with ggplot and vscode. I couldn't create a reprex to reproduce this bug, maybe it's only interactive?
This is the error I get:
Here's one example:
Traceback:
And here's another example:
Sometimes, it happens almost immediately, sometimes first after many tries. I'm using vscode 1.88.1, R 4.3.3, Windows 11, all R packages up to date (and also all VScode extensions).
When I once get this issue, it appears each time for ggplot-plots - but not, if I try to create a reprex. The reprex is displayed in the "viewer" tab, while plots are shown in the "plots" tab. I guess it could be an interactive-issue.