MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _blit_draw

Method _blit_draw

lib/matplotlib/animation.py:1202–1222  ·  view source on GitHub ↗
(self, artists)

Source from the content-addressed store, hash-verified

1200
1201 # The rest of the code in this class is to facilitate easy blitting
1202 def _blit_draw(self, artists):
1203 # Handles blitted drawing, which renders only the artists given instead
1204 # of the entire figure.
1205 updated_ax = {a.axes for a in artists}
1206 # Enumerate artists to cache Axes backgrounds. We do not draw
1207 # artists yet to not cache foreground from plots with shared Axes
1208 for ax in updated_ax:
1209 # If we haven't cached the background for the current view of this
1210 # Axes object, do so now. This might not always be reliable, but
1211 # it's an attempt to automate the process.
1212 cur_view = ax._get_view()
1213 view, bg = self._blit_cache.get(ax, (object(), None))
1214 if cur_view != view:
1215 self._blit_cache[ax] = (
1216 cur_view, ax.figure.canvas.copy_from_bbox(ax.bbox))
1217 # Make a separate pass to draw foreground.
1218 for a in artists:
1219 a.axes.draw_artist(a)
1220 # After rendering all the needed artists, blit each Axes individually.
1221 for ax in updated_ax:
1222 ax.figure.canvas.blit(ax.bbox)
1223
1224 def _blit_clear(self, artists):
1225 # Get a list of the Axes that need clearing from the artists that

Callers 1

_post_drawMethod · 0.95

Calls 5

_get_viewMethod · 0.45
getMethod · 0.45
copy_from_bboxMethod · 0.45
draw_artistMethod · 0.45
blitMethod · 0.45

Tested by

no test coverage detected