matplotlib / matplotlib/ipympl

ipympl for matplotlib not created through pyplot

Open
#221 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
1.7k
Forks
234
PR merge metrics
No merged PRs in 30d

Description

Is it possible to use ipympl starting from an arbitrary matplotlib figure? If yes, an example would be helpful. Thanks!

Use Case: I would like to use ipympl for SageMath plots. The later do have a method to
convert them to matplotlib figure. However the figure has not been created with the usual
pyplot workflow, and does not have a canvas setup.

In a jupyter notebook with the SageMath kernel (e.g. using the binder link from https://github.com/sagemath/sage-binder-env/ after installing ipympl with `sage -pip install ipyml`)
```
%matplotlib widget
p = plot(sin(x))
fig = p.matplotlib();
type(fig.canvas)

```

It could well be that SageMath is producing weird matplotlib figures though.

cc: @zerline

Contributor guide

Open the contributing guide

Research direction

No project files or tests are named. Start by reproducing the Jupyter notebook snippet with the SageMath-produced matplotlib figure and inspect whether ipympl can provide a canvas for it; done means establishing whether this workflow works and documenting a minimal example or the limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
data-visualization, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.