本文整理匯總了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