vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

Fail to show further plots after closing R Plot

Open Fred-Wu opened this issue 4 years ago • 11 comments

After plotting many graphs, when I tried to plot again the R Plot panel no longer pop up. Even I managed to make R Plot panel appear again and delete or previous graph, the plot still wouldn't show in the panel.

Any suggestions?

plot(1:10)

image

Fred-Wu avatar Aug 22 '21 10:08 Fred-Wu

Does "Open in external browser" show the plots correctly?

renkun-ken avatar Aug 23 '21 03:08 renkun-ken

Does "Open in external browser" show the plots correctly?

They do initially. But after ploting fails, "Open in external browser" no longer works too, stuck like below. It happened again just now.

image

Fred-Wu avatar Aug 23 '21 04:08 Fred-Wu

It just happened again. However this time, I was able to open the graph just by re-opening it from the browser history. The graph was actually on it. Upon re-opening, the following error message appeared in the terminal, which might indicate why plot panel did not pop up when entering the code from editor or terminal initially.

r$> Error in grid.Call.graphics(C_upviewport, as.integer(n)) : 
cannot pop the top-level viewport ('grid' and 'graphics' output mixed?)

When making the new plot, those plots will keep showing in the the R Plot tab. But if close the tab, it won't automatically open it anymore.

Fred-Wu avatar Aug 24 '21 12:08 Fred-Wu

@ManuelHentschel @nx10 Do you think the problem is in vscode-R plot viewer or the httpgd backend?

renkun-ken avatar Aug 24 '21 14:08 renkun-ken

My first guess would be the httpgd backend, since the problem also affects the external browser and produces errors in R (the vscode viewer only interacts with httpgd through http/ws, so it shouldn't be able to cause these errors).

Though it could be that e.g. the dynamic resizing from the plot viewer requests too many updates and stalls the R process.

ManuelHentschel avatar Aug 25 '21 08:08 ManuelHentschel

This could be a backend problem. @Fred-Wu can you provide plotting code to recreate the issue? What version of httpgd and R are you using?

nx10 avatar Aug 25 '21 11:08 nx10

This could be a backend problem. @Fred-Wu can you provide plotting code to recreate the issue? What version of httpgd and R are you using?

I am on R version 4.1.0 and httpgd version 1.1.1.

Sorry, I don't think I am able to provide codes to reproduce the issue. It happened just after keep plotting a bunch of different figures, usually 3-D plots or maps. It's pretty random.

Fred-Wu avatar Aug 25 '21 13:08 Fred-Wu

Thank you for your reply.

Sorry, I don't think I am able to provide codes to reproduce the issue. It happened just after keep plotting a bunch of different figures, usually 3-D plots or maps. It's pretty random.

I understand. But I need some more information to investigate this, as I have never seen this error. What packages do you use to plot? Are there multiple plots on one page?

nx10 avatar Aug 25 '21 14:08 nx10

I sometimes encounter this too, but it is quite hard to reliably reproduce. I'll see if I could find a way to reproduce it somehow.

renkun-ken avatar Aug 25 '21 14:08 renkun-ken

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Aug 26 '22 02:08 github-actions[bot]

If this still happens with the upcoming dev version of httpgd 2.0 let me know (https://github.com/nx10/httpgd/pull/111)

nx10 avatar Aug 26 '22 08:08 nx10

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Aug 28 '23 01:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Sep 11 '23 01:09 github-actions[bot]