posit-dev / posit-dev/positron
Plot panel displays errors when it is not large enough to show plot
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 184
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 206
Description
System details:
Positron and OS details:
Positron Version: 2025.07.0 (Universal) build 74
Code - OSS Version: 1.100.0
Commit: fe621e856f2e66144c97d30a3c77471947048e61
Date: 2025-06-09T03:37:56.615Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0
Interpreter details:
R 4.4.2
Describe the issue:
When a plot doesn't fit in the plot panel, it shows a stack trace and an error message:
Error rendering plot to 'Auto' size: Failed to process positron.plot request: Failed to render plot with `id` 360aab5f-01a7-4427-8e57-b109e49ae1a9 due to: Error evaluating '.ps.graphics.render_plot_from_recording(id = "360aab5f-01a7-4427-8e57-b109e49ae1a9", width = 525L, height = 325L, pixel_ratio = 2, format = "png")': invalid graphics state R backtrace: 0. tryCatchOne(expr, names, parentenv, handlers[[1L]]) 1. tryCatchList(expr, classes, parentenv, handlers) 2. tryCatch(.External2(C_playSnapshot, x), error = restore) 3. grDevices::replayPlot(recording) 4. withCallingHandlers(expr, warning = function(w) if (inherits(w, classes)) tryInvokeRestart("muffleWarning")) 5. suppressWarnings(grDevices::replayPlot(recording)) 6. with_graphics_device(path, width, height, pixel_ratio, format, {
Steps to reproduce the issue:
Make the plot panel relatively short (vertically). Run the following:
par(mfrow = c(2, 1))
plot(1:9, 1:9)
plot(9:1, 1:9)
The result looks like this:
If you make the panel tall and run the same code, it looks like this:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue in the plot panel with R using par(mfrow = c(2, 1)) and the two plot commands, while the panel is vertically short. Trace the plot rendering path from the panel and compare it with the behavior when the panel is tall; done means the short panel no longer displays a stack trace or rendering error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, typescript
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100