Skip to content

Commit af0e1ce

Browse files
authored
Draw issues with jupyter lab and %matplotlib widget (#129)
* Draw issues with jupyter lab and %matplotlib widget * Changelog
1 parent eb6de04 commit af0e1ce

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

changelog/129.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Switched the backend to use ``draw_idle`` to avoid Jupyter lab widget issues.

mpl_animators/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,12 @@ def _set_active_slider(self, ind):
257257
def _highlight_slider(self, ind):
258258
ax = self.sliders[ind]
259259
[a.set_linewidth(2.0) for n, a in ax.spines.items()]
260-
self.fig.canvas.draw()
260+
self.fig.canvas.draw_idle()
261261

262262
def _dehighlight_slider(self, ind):
263263
ax = self.sliders[ind]
264264
[a.set_linewidth(1.0) for n, a in ax.spines.items()]
265-
self.fig.canvas.draw()
265+
self.fig.canvas.draw_idle()
266266

267267
# =============================================================================
268268
# Build the figure and place the widgets

0 commit comments

Comments
 (0)