Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH : Nbagg blit #4290

Closed
wants to merge 2 commits into from
Closed

ENH : Nbagg blit #4290

wants to merge 2 commits into from

Conversation

tacaswell
Copy link
Member

Closes #4288

@tacaswell tacaswell added this to the Color overhaul milestone Mar 28, 2015
@tacaswell
Copy link
Member Author

attn @pelson

@tacaswell
Copy link
Member Author

Also closes #4287

@tacaswell
Copy link
Member Author

attn @blink1073 This might be relevant for scikit-image's stuff.

@blink1073
Copy link
Member

Ooh, shiny! I'll check it out tonight.

@blink1073
Copy link
Member

This appears to have broken UAT 13 - Animation. If I run the all of the cells, it yields an empty figure. If I try and run it again, I get a static line with an animated line running through it, and this error:

ERROR:tornado.application:Exception in callback <bound method TimerTornado._on_timer of <matplotlib.backends.backend_nbagg.TimerTornado object at 0x109d78450>>
Traceback (most recent call last):
  File "/Users/stevensilvester/Library/Python/2.7/lib/python/site-packages/tornado/ioloop.py", line 989, in _run
    return self.callback()
  File "/Users/stevensilvester/workspace/matplotlib/lib/matplotlib/backend_bases.py", line 1290, in _on_timer
    ret = func(*args, **kwargs)
  File "/Users/stevensilvester/workspace/matplotlib/lib/matplotlib/animation.py", line 925, in _step
    still_going = Animation._step(self, *args)
  File "/Users/stevensilvester/workspace/matplotlib/lib/matplotlib/animation.py", line 784, in _step
    self._draw_next_frame(framedata, self._blit)
  File "/Users/stevensilvester/workspace/matplotlib/lib/matplotlib/animation.py", line 804, in _draw_next_frame
    self._post_draw(framedata, blit)
  File "/Users/stevensilvester/workspace/matplotlib/lib/matplotlib/animation.py", line 827, in _post_draw
    self._blit_draw(self._drawn_artists, self._blit_cache)
  File "/Users/stevensilvester/workspace/matplotlib/lib/matplotlib/animation.py", line 841, in _blit_draw
    bg_cache[a.axes] = a.figure.canvas.copy_from_bbox(a.axes.bbox)
  File "/Users/stevensilvester/workspace/matplotlib/lib/matplotlib/backends/backend_webagg_core.py", line 196, in copy_from_bbox
    renderer = self._last_renderer
AttributeError: 'FigureCanvasNbAgg' object has no attribute '_last_renderer'

@blink1073
Copy link
Member

If I run UAT 1 and then skip down to UAT 13, it runs but the spines and tick labels are flickering.

@tacaswell
Copy link
Member Author

If you resize it a couple times it eventually sorts it's self out.

I think the underlying issue is related to it actually having two renderers so half the time it ends up drawing the line on to a renderer that never had the rest of the artists drawn. The re-sizing causes enough thrashing that eventually things work out.

Looking into this now.

@tacaswell
Copy link
Member Author

There are other problems such as the animation object not stopping after the figure is closed which pins a CPU....

@WeatherGod
Copy link
Member

I would bet that that problem is the same as the one recently reported for
starting animations from another cell. Both the start and the finishing of
an animation is triggered through events emitted from the figure. If those
events aren't making it back to the animation objects, then nothing changes.
On Mar 29, 2015 12:52 AM, "Thomas A Caswell" notifications@github.com
wrote:

There are other problems such as the animation object not stopping after
the figure is closed which pins a CPU....


Reply to this email directly or view it on GitHub
#4290 (comment)
.

fixes some issues (makes sure we always have a renderer), but something
much worse is wrong underneath (the animation objects goes crazy and
eats all of the CPU).
@tacaswell tacaswell modified the milestones: Color overhaul, next major release (2.0) Oct 26, 2015
@mdboom
Copy link
Member

mdboom commented Dec 14, 2015

Apologies that this has become a bit stale. Rebasing this on top of master, I get:

Traceback (most recent call last):
  File "/home/mdboom/.pyenv/versions/miniconda3-3.16.0/lib/python3.4/site-packages/tornado/ioloop.py", line 1020, in _run
    return self.callback()
  File "/home/mdboom/Work/builds/matplotlib/lib/matplotlib/backend_bases.py", line 1305, in _on_timer
    ret = func(*args, **kwargs)
  File "/home/mdboom/Work/builds/matplotlib/lib/matplotlib/animation.py", line 1021, in _step
    still_going = Animation._step(self, *args)
  File "/home/mdboom/Work/builds/matplotlib/lib/matplotlib/animation.py", line 827, in _step
    self._draw_next_frame(framedata, self._blit)
  File "/home/mdboom/Work/builds/matplotlib/lib/matplotlib/animation.py", line 845, in _draw_next_frame
    self._pre_draw(framedata, blit)
  File "/home/mdboom/Work/builds/matplotlib/lib/matplotlib/animation.py", line 858, in _pre_draw
    self._blit_clear(self._drawn_artists, self._blit_cache)
  File "/home/mdboom/Work/builds/matplotlib/lib/matplotlib/animation.py", line 898, in _blit_clear
    a.figure.canvas.restore_region(bg_cache[a])
KeyError: <matplotlib.axes._subplots.AxesSubplot object at 0x7f38d7acfb38>

It would be nice to see this revived...

@tacaswell tacaswell modified the milestones: 2.0 (style change major release), 2.1 (next point release) Mar 21, 2016
@QuLogic QuLogic changed the base branch from color_overhaul to master October 16, 2016 02:48
@tacaswell tacaswell modified the milestone: 2.1 (next point release) Aug 29, 2017
mbewley added a commit to mbewley/matplotlib that referenced this pull request Jan 28, 2018
…plotlib#4290. Everything seems to work ok except UAT4 doesn't close the old figure (just gets rid of the interactive widgets around it), and UAT13 has flickering at the edges of the axis (y ticks).
mbewley added a commit to mbewley/matplotlib that referenced this pull request Jan 29, 2018
… compatibility with latest jupyter notebook).
@jklymak
Copy link
Member

jklymak commented May 9, 2018

Closing in lieu of #9240

@jklymak jklymak closed this May 9, 2018
@ianhi ianhi mentioned this pull request Dec 3, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nbagg blit support
5 participants