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

Method restore_region

lib/matplotlib/backends/backend_agg.py:339–372  ·  view source on GitHub ↗

Restore the saved region. If bbox (instance of BboxBase, or its extents) is given, only the region specified by the bbox will be restored. *xy* (a pair of floats) optionally specifies the new position (the LLC of the original region, not the LLC of the bbox)

(self, region, bbox=None, xy=None)

Source from the content-addressed store, hash-verified

337 return False
338
339 def restore_region(self, region, bbox=None, xy=None):
340 """
341 Restore the saved region. If bbox (instance of BboxBase, or
342 its extents) is given, only the region specified by the bbox
343 will be restored. *xy* (a pair of floats) optionally
344 specifies the new position (the LLC of the original region,
345 not the LLC of the bbox) where the region will be restored.
346
347 >>> region = renderer.copy_from_bbox()
348 >>> x1, y1, x2, y2 = region.get_extents()
349 >>> renderer.restore_region(region, bbox=(x1+dx, y1, x2, y2),
350 ... xy=(x1-dx, y1))
351
352 """
353 if bbox is not None or xy is not None:
354 if bbox is None:
355 x1, y1, x2, y2 = region.get_extents()
356 elif isinstance(bbox, BboxBase):
357 x1, y1, x2, y2 = bbox.extents
358 else:
359 x1, y1, x2, y2 = bbox
360
361 if xy is None:
362 ox, oy = x1, y1
363 else:
364 ox, oy = xy
365
366 # The incoming data is float, but the _renderer type-checking wants
367 # to see integers.
368 self._renderer.restore_region(region, int(x1), int(y1),
369 int(x2), int(y2), int(ox), int(oy))
370
371 else:
372 self._renderer.restore_region(region)
373
374 def start_filter(self):
375 """

Callers 15

_blit_clearMethod · 0.45
set_activeMethod · 0.45
set_activeMethod · 0.45
onmoveMethod · 0.45
onmoveMethod · 0.45
updateMethod · 0.45
onmoveMethod · 0.45
on_motionMethod · 0.45
on_releaseMethod · 0.45
restore_regionMethod · 0.45
blitting.pyFile · 0.45

Calls 1

get_extentsMethod · 0.45

Tested by 1