Plots Pane: When extension host is restarted, plots stop working if generated from a file

Open
#17,619 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
54/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
matplotlib, python, r, typescript

Research direction

Start by tracing how plots generated from a file are stored and re-rendered in the Plots pane after an extension host restart; compare that path with plots from the console. Reproduce with the provided Python or R script, then use Developer: Restart Extension Host. Done means the existing plots render again without requiring a window reload or manual interaction.

Written by the indexing model from the issue text.

Description

area: plots bug

It appears as if when we run a file and it generates a plot -- when we later restart the extension host, the plot seems to disappear and will never re-render itself. This can be observed between both R and python, but the critical piece is that the plot must originate from running in a file, not the console

Run a python script like so a few times:

import matplotlib.pyplot as plt

# plt.rcParams["figure.dpi"] = 200  # a non-default DPI used to change the PDF's page size; it shouldn't now

fig, ax = plt.subplots()
ax.plot([1, 2, 3, 4], [1, 4, 2, 3], label="series")
ax.set_title("Response over time")
ax.set_xlabel("Time (s)")
ax.set_ylabel("Amplitude")
ax.legend()
plt.show()

or R:

pllot(1:10)

Notice that the R script is super simple, so don't just type it into the Console. The bug is when it is run from a file.

You'll get several rendered plots. Now, run the command Developer: Restart Extension Host and the plots will all disappear. If you click on any one of them it just shows "Rendering Plot" in the pane forever without ever doing anything. Nothing seems to bring them back, even including copying or opening in an editor window.

If you run the command Developer: Reload Window it does resolve itself and the plots are redrawn, but only after interacting with them.

Screenshot 2026-12-02 at 12 56 50 PM
Dominant language
TypeScript
Stars
4.4k
Forks
207
Avg merge
1d 16h
Merged PRs (30d)
308

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/positron

All issues in posit-dev/positron

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.