Home > Back-end >  How to refresh plots without needing to close the previous plot?
How to refresh plots without needing to close the previous plot?

Time:02-15

How do I get VSCode to refresh the plot when making a new plot without needing to close the previous plot tab? Ideally, it should open up a new tab with the new plot next to the old one.

gif displaying the close tab to refresh plot problem

Moreover, when using Httpgd, even tho the plot refreshes without me having to close the previous plot, it opens up in a separate window outside VSCode. How do I get it to open up as a new tab like in the gif above?

CodePudding user response:

I had the exact same problem and what fixed it for me was simply, in vscode, going into:

Files > Preferences > Settings > section Extensions > scroll down and find R: find the section "Plot: Use Httpgd" and check it, and restart Vscode.

I can't confirm but I believe it might have started after installing the httpgd package, because I had the behavior you desire before installation, and the exact same behavior you experience after httpgd installation. Of course if my solution works for you (I hope), it will work under httpgd after and not the base default VsCode/R-plot viewer as in your gif.

CodePudding user response:

@coip pointed out that the steps given on this stackoverflow post to me. Downloading the httpgd package from CRAN fixed the problem for me.

  • Related