matplotlib / matplotlib/ipympl
Plot output with ipywidgets formatting incorrectly
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 1.7k
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
## Describe the issue
I built a small GUI within a notebook and had two figures in an ipywidgets HBox object. the latest version of ipympl made it so I could not have both figures in an HBox and generally disrupted the formatting of the object. I was able to fix the issue by reverting both matplotlib and the ipympl versions.
a short script that generates the broken output is as follows
```python
%matplotlib widget
from IPython.display import display, HTML
display(HTML(".container { width:100%!important;}"))
import ipywidgets as ipy
import matplotlib.pyplot as plt
import numpy as np
out1 = ipy.Output()
b1 = ipy.Button(description = 'button1')
b2 = ipy.Button(description = 'button2')
x = np.linspace(0,7,21)
y = np.sin(x)
with out1:
fig,ax = plt.subplots()
ax.plot(x,y)
display(ipy.HBox([out1,ipy.VBox([b1,b2])]))
```
## Versions
(working version)
```
ipympl == 0.5.8
matplotlib == 3.3.3
```
(broken version)
```ipympl == 0.8.8
matplotlib == 3.5.1
```
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
Run the supplied notebook script with the listed working and broken matplotlib/ipympl versions, then compare the HBox layout and widget formatting. Done means the figure and buttons render correctly together in the HBox under the affected versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, matplotlib, python
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100