本文整理汇总了Python中matplotlib.cbook.Grouper方法的典型用法代码示例。如果您正苦于以下问题:Python cbook.Grouper方法的具体用法?Python cbook.Grouper怎么用?Python cbook.Grouper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.cbook
的用法示例。
在下文中一共展示了cbook.Grouper方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_grouper
# 需要导入模块: from matplotlib import cbook [as 别名]
# 或者: from matplotlib.cbook import Grouper [as 别名]
def test_grouper():
class dummy():
pass
a, b, c, d, e = objs = [dummy() for j in range(5)]
g = cbook.Grouper()
g.join(*objs)
assert set(list(g)[0]) == set(objs)
assert set(g.get_siblings(a)) == set(objs)
for other in objs[1:]:
assert g.joined(a, other)
g.remove(a)
for other in objs[1:]:
assert not g.joined(a, other)
for A, B in itertools.product(objs[1:], objs[1:]):
assert g.joined(A, B)
示例2: get_shared_x_axes
# 需要导入模块: from matplotlib import cbook [as 别名]
# 或者: from matplotlib.cbook import Grouper [as 别名]
def get_shared_x_axes(self):
"""Return a reference to the shared axes Grouper object for x axes."""
return self._shared_x_axes
示例3: get_shared_y_axes
# 需要导入模块: from matplotlib import cbook [as 别名]
# 或者: from matplotlib.cbook import Grouper [as 别名]
def get_shared_y_axes(self):
"""Return a reference to the shared axes Grouper object for y axes."""
return self._shared_y_axes
示例4: get_shared_x_axes
# 需要导入模块: from matplotlib import cbook [as 别名]
# 或者: from matplotlib.cbook import Grouper [as 别名]
def get_shared_x_axes(self):
'Return a copy of the shared axes Grouper object for x axes'
return self._shared_x_axes
示例5: get_shared_y_axes
# 需要导入模块: from matplotlib import cbook [as 别名]
# 或者: from matplotlib.cbook import Grouper [as 别名]
def get_shared_y_axes(self):
'Return a copy of the shared axes Grouper object for y axes'
return self._shared_y_axes
示例6: test_grouper_private
# 需要导入模块: from matplotlib import cbook [as 别名]
# 或者: from matplotlib.cbook import Grouper [as 别名]
def test_grouper_private():
class dummy():
pass
objs = [dummy() for j in range(5)]
g = cbook.Grouper()
g.join(*objs)
# reach in and touch the internals !
mapping = g._mapping
for o in objs:
assert ref(o) in mapping
base_set = mapping[ref(objs[0])]
for o in objs[1:]:
assert mapping[ref(o)] is base_set