Description
The default behaviour is to create plots in a PNG and then display them in a VSCode window. However the default PNG size does not display well and the plot is overwritten when a new plot is created, so you cannot go backwards/forwards between plots created in a session.
The first issue could be solved by creating a .Rprofile
file at the root of the workspace (/workspaces/r-dev-env/
) with
options(vsc.dev.args = list(width = 800, height = 600)
However, it may be better to switch to httpgd graphics which display plots in a device with functionality including backwards/forwards navigation and zoom. The Plot viewerhttps://github.com/REditorSupport/vscode-R/wiki/Plot-viewer#svg-in-httpgd-plot-viewer) section of the vscode R extension docs describe how to set this up. It requires installing an R package, so we will need to investigate if we can install this in the default version of R and keep the library clean for new builds of R as we now do for the languageserver package (discussed here #25).
If it's not possible to do this cleanly, then we may want to set the .Rprofile
as above and link to the plot viewer documentation so that users know how to switch to an alternative if useful for the work they are doing.