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

Provide better `vsc.dev.args` defaults

Open ThomasSoeiro opened this issue 2 months ago • 1 comments

Describe the bug

Plots are barely readable with default dimensions and resolution (whatever the layout).

getOption("vsc.dev.args")
# $width
# [1] 800
# 
# $height
# [1] 1200
# 

To Reproduce

Create any plot, e.g.:

plot(1)

Can you fix this issue by yourself? (We appreciate the help)

Maybe.

vsc.dev.args is documented in the wiki.

I guess we need to edit:

https://github.com/REditorSupport/vscode-R/blob/61088253ee8adf32933590cd436e2bb93c6f3597/package.json#L1822-L1828

Which is applied by:

https://github.com/REditorSupport/vscode-R/blob/61088253ee8adf32933590cd436e2bb93c6f3597/R/session/vsc.R#L38

Expected behavior

Provide better default (especially 1:1 aspect ratio and higher resolution), e.g.:

  • width: 1200,
  • height: 1200,
  • res: 200

This is more in line with e.g. png() et al., ggsave() defaults, or RStudio plot viewer.

Screenshots

Default:

Image

With suggested change applied in settings.json:

    "r.plot.devArgs": {
        "width": 1200,
        "height": 1200,
        "res": 200
    }

or in .Rprofile:

options(vsc.dev.args = list(width = 1200, height = 1200, res = 200))

we get:

Image

Environment (please complete the following information):

  • OS: all
  • VSCode Version: VSCodium 1.106.37943
  • R Version: all
  • vscode-R version: 2.8.6

Additional context

I am aware of httpgd; I am suggested better defaults for the default viewer.

Thanks for this excellent extension!

ThomasSoeiro avatar Dec 09 '25 15:12 ThomasSoeiro

Additionnaly, I just noticed that the res properties is not allowed although it is taken into account:

Image

ThomasSoeiro avatar Dec 10 '25 11:12 ThomasSoeiro