Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 664ab81

Browse files
author
jdollichon
committed
Sorting drawn artists by their zorder when blitting
1 parent 6ec80ea commit 664ab81

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/matplotlib/animation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,7 @@ def _draw_frame(self, framedata):
17231723

17241724
# Call the func with framedata and args. If blitting is desired,
17251725
# func needs to return a sequence of any artists that were modified.
1726-
self._drawn_artists = self._func(framedata, *self._args)
1726+
self._drawn_artists = sorted(self._func(framedata, *self._args), key=lambda x: x.get_zorder())
17271727
if self._blit:
17281728
if self._drawn_artists is None:
17291729
raise RuntimeError('The animation function must return a '

0 commit comments

Comments
 (0)