本文简要介绍 python 语言中 matplotlib.cbook.Grouper
的用法。
-
基础:
object
disjoint-set 数据结构。
可以使用
join()
连接对象,使用joined()
测试连通性,并且可以使用该对象作为迭代器来检索所有不相交集。被连接的对象必须是可散列的并且weak-referenceable。
例子
>>> from matplotlib.cbook import Grouper >>> class Foo: ... def __init__(self, s): ... self.s = s ... def __repr__(self): ... return self.s ... >>> a, b, c, d, e, f = [Foo(x) for x in 'abcdef'] >>> grp = Grouper() >>> grp.join(a, b) >>> grp.join(b, c) >>> grp.join(d, e) >>> list(grp) [[a, b, c], [d, e]] >>> grp.joined(a, b) True >>> grp.joined(a, c) True >>> grp.joined(a, d) False
用法
class matplotlib.cbook.Grouper(init=())
相关用法
- Python matplotlib axvspan用法及代码示例
- Python matplotlib Axes.get_legend_handles_labels用法及代码示例
- Python matplotlib AbstractMovieWriter用法及代码示例
- Python matplotlib triplot用法及代码示例
- Python matplotlib StarPolygonCollection.set_hatch用法及代码示例
- Python matplotlib Axes.hist用法及代码示例
- Python matplotlib boxplot用法及代码示例
- Python matplotlib subplots用法及代码示例
- Python matplotlib InsetPosition用法及代码示例
- Python matplotlib ToolManager.toolmanager_disconnect用法及代码示例
- Python matplotlib Figure.set_size_inches用法及代码示例
- Python matplotlib figlegend用法及代码示例
- Python matplotlib Axes.step用法及代码示例
- Python matplotlib Axes.contour用法及代码示例
- Python matplotlib LassoSelector用法及代码示例
- Python matplotlib BrokenBarHCollection.set_hatch用法及代码示例
- Python matplotlib Axes.plot用法及代码示例
- Python matplotlib Axes.semilogx用法及代码示例
- Python matplotlib Axes.semilogy用法及代码示例
- Python matplotlib MovieWriterRegistry.register用法及代码示例
- Python matplotlib PolyQuadMesh.set_hatch用法及代码示例
- Python matplotlib warn_deprecated用法及代码示例
- Python matplotlib Text.set_bbox用法及代码示例
- Python matplotlib Axes.inset_axes用法及代码示例
- Python matplotlib delete_parameter用法及代码示例
注:本文由纯净天空筛选整理自skytowner.com大神的英文原创作品 matplotlib.cbook.Grouper。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。