Skip to content

Render stored Matplotlib png output as a fallback when opening a notebook  #8635

@asteppke

Description

@asteppke

Actual behaviour

With the current ipympl and using %matplotlib widget as a backend VS code can render this example without issues:

%matplotlib widget

from matplotlib import pyplot as plt

fig, ax = plt.subplots()
ax.plot([0,1,2], [2,3,4] ,"o-")

image

Though, when saving and reloading the notebook file no image is shown (although a static image is available):

image

Expected behaviour

The small </> icon on the left allows to change the mimetype representation. When this is changed manually to png the alternative widget representation that was previously saved is shown correctly:

image

So VS code does not recognize that without a running/current widget available that the png static representation should be shown instead.

Environment data

  • VS Code version: 1.63.2
  • Jupyter Extension version v2021.11.1001550889
  • Python Extension version v2021.12.1559732655
  • OS (Windows | Mac | Linux distro) and version: Windows 10
  • Python and/or Anaconda version: 3.9.9
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: Local

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugipywidgetsRendering, loading, saving, anything to do with IPyWidgetsnotebook-outputon-testplan

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions