Plotting a `stars` raster does not work while `terra` does.
Positron Version:
Positron Version: 2024.06.1 (system setup) build 2024.06.1-54 Code - OSS Version: 1.90.0 Commit: 5115c73e0670f39139e55eeedf0717b468a0658d Date: 2024-07-03T03:17:46.140Z Electron: 29.4.0 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Windows_NT x64 10.0.22631
Steps to reproduce the issue:
library(stars)
library(terra)
r <- matrix(runif(9), nrow = 3) |>
st_as_stars()
plot(r)
rast(r) |> plot()
What did you expect to happen?
Plotting the stars raster only plots the legend while plotting a terra raster works properly. I tried the same in the R console outside positron and both plots were correct.
Were there any error messages in the output or Developer Tools console?
No
Thanks for reporting (and for the minimal example); I can reproduce this.
Interestingly enough if you render a second plot and then go back to the first one, it's rendered correctly!
Take a look at the code for plot.stars: https://github.com/r-spatial/stars/blob/main/R/plot.R
I believe this is related to #3667 and #3562 and our problems with par().
Verified Fixed
Positron Version(s) : 2025.04.0-95
OS Version : OSX
Test scenario(s)
Both plots look good
Link(s) to TestRail test cases run or created: