当前位置: 首页>>代码示例>>Python>>正文


Python RendererBase.new_gc方法代码示例

本文整理汇总了Python中matplotlib.backend_bases.RendererBase.new_gc方法的典型用法代码示例。如果您正苦于以下问题:Python RendererBase.new_gc方法的具体用法?Python RendererBase.new_gc怎么用?Python RendererBase.new_gc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.backend_bases.RendererBase的用法示例。


在下文中一共展示了RendererBase.new_gc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: check

# 需要导入模块: from matplotlib.backend_bases import RendererBase [as 别名]
# 或者: from matplotlib.backend_bases.RendererBase import new_gc [as 别名]
 def check(master_transform, paths, all_transforms,
           offsets, facecolors, edgecolors):
     rb = RendererBase()
     raw_paths = list(rb._iter_collection_raw_paths(
         master_transform, paths, all_transforms))
     gc = rb.new_gc()
     ids = [path_id for xo, yo, path_id, gc0, rgbFace in
            rb._iter_collection(gc, master_transform, all_transforms,
                                range(len(raw_paths)), offsets,
                                transforms.IdentityTransform(),
                                facecolors, edgecolors, [], [], [False],
                                [], 'data')]
     uses = rb._iter_collection_uses_per_path(
         paths, all_transforms, offsets, facecolors, edgecolors)
     if raw_paths:
         seen = np.bincount(ids, minlength=len(raw_paths))
         assert set(seen).issubset([uses - 1, uses])
开发者ID:vapier,项目名称:matplotlib,代码行数:19,代码来源:test_backend_bases.py

示例2: check

# 需要导入模块: from matplotlib.backend_bases import RendererBase [as 别名]
# 或者: from matplotlib.backend_bases.RendererBase import new_gc [as 别名]
 def check(master_transform, paths, all_transforms,
           offsets, facecolors, edgecolors):
     rb = RendererBase()
     raw_paths = list(rb._iter_collection_raw_paths(
         master_transform, paths, all_transforms))
     gc = rb.new_gc()
     ids = [path_id for xo, yo, path_id, gc0, rgbFace in
            rb._iter_collection(gc, master_transform, all_transforms,
                                range(len(raw_paths)), offsets,
                                transforms.IdentityTransform(),
                                facecolors, edgecolors, [], [], [False],
                                [], 'data')]
     uses = rb._iter_collection_uses_per_path(
         paths, all_transforms, offsets, facecolors, edgecolors)
     seen = [0] * len(raw_paths)
     for i in ids:
         seen[i] += 1
     for n in seen:
         assert n in (uses-1, uses)
开发者ID:Jajauma,项目名称:dotfiles,代码行数:21,代码来源:test_backend_bases.py


注:本文中的matplotlib.backend_bases.RendererBase.new_gc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。