本文整理汇总了Python中matplotlib.image._draw_list_compositing_images方法的典型用法代码示例。如果您正苦于以下问题:Python image._draw_list_compositing_images方法的具体用法?Python image._draw_list_compositing_images怎么用?Python image._draw_list_compositing_images使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.image
的用法示例。
在下文中一共展示了image._draw_list_compositing_images方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: draw
# 需要导入模块: from matplotlib import image [as 别名]
# 或者: from matplotlib.image import _draw_list_compositing_images [as 别名]
def draw(self, renderer):
"""
Render the figure using :class:`matplotlib.backend_bases.RendererBase`
instance *renderer*.
"""
# draw the figure bounding box, perhaps none for white figure
if not self.get_visible():
return
artists = sorted(
(artist for artist in (self.patches + self.lines + self.artists
+ self.images + self.axes + self.texts
+ self.legends)
if not artist.get_animated()),
key=lambda artist: artist.get_zorder())
try:
renderer.open_group('figure')
if self.get_constrained_layout() and self.axes:
self.execute_constrained_layout(renderer)
if self.get_tight_layout() and self.axes:
try:
self.tight_layout(renderer,
**self._tight_parameters)
except ValueError:
pass
# ValueError can occur when resizing a window.
if self.frameon:
self.patch.draw(renderer)
mimage._draw_list_compositing_images(
renderer, self, artists, self.suppressComposite)
renderer.close_group('figure')
finally:
self.stale = False
self._cachedRenderer = renderer
self.canvas.draw_event(renderer)
示例2: draw
# 需要导入模块: from matplotlib import image [as 别名]
# 或者: from matplotlib.image import _draw_list_compositing_images [as 别名]
def draw(self, renderer):
"""
Render the figure using :class:`matplotlib.backend_bases.RendererBase`
instance *renderer*.
"""
# draw the figure bounding box, perhaps none for white figure
if not self.get_visible():
return
artists = self.get_children()
artists.remove(self.patch)
artists = sorted(
(artist for artist in artists if not artist.get_animated()),
key=lambda artist: artist.get_zorder())
for ax in self.axes:
locator = ax.get_axes_locator()
if locator:
pos = locator(ax, renderer)
ax.apply_aspect(pos)
else:
ax.apply_aspect()
for child in ax.get_children():
if hasattr(child, 'apply_aspect'):
locator = child.get_axes_locator()
if locator:
pos = locator(child, renderer)
child.apply_aspect(pos)
else:
child.apply_aspect()
try:
renderer.open_group('figure')
if self.get_constrained_layout() and self.axes:
self.execute_constrained_layout(renderer)
if self.get_tight_layout() and self.axes:
try:
self.tight_layout(renderer,
**self._tight_parameters)
except ValueError:
pass
# ValueError can occur when resizing a window.
self.patch.draw(renderer)
mimage._draw_list_compositing_images(
renderer, self, artists, self.suppressComposite)
renderer.close_group('figure')
finally:
self.stale = False
self._cachedRenderer = renderer
self.canvas.draw_event(renderer)
示例3: draw
# 需要导入模块: from matplotlib import image [as 别名]
# 或者: from matplotlib.image import _draw_list_compositing_images [as 别名]
def draw(self, renderer):
"""
Render the figure using :class:`matplotlib.backend_bases.RendererBase`
instance *renderer*.
"""
# draw the figure bounding box, perhaps none for white figure
if not self.get_visible():
return
artists = sorted(
(artist for artist in (self.patches + self.lines + self.artists
+ self.images + self.axes + self.texts
+ self.legends)
if not artist.get_animated()),
key=lambda artist: artist.get_zorder())
try:
renderer.open_group('figure')
if self.get_constrained_layout() and self.axes:
if True:
self.execute_constrained_layout(renderer)
else:
pass
if self.get_tight_layout() and self.axes:
try:
self.tight_layout(renderer,
**self._tight_parameters)
except ValueError:
pass
# ValueError can occur when resizing a window.
if self.frameon:
self.patch.draw(renderer)
mimage._draw_list_compositing_images(
renderer, self, artists, self.suppressComposite)
renderer.close_group('figure')
finally:
self.stale = False
self._cachedRenderer = renderer
self.canvas.draw_event(renderer)