本文整理汇总了Python中glue.core.data_collection.DataCollection.new_subset_group方法的典型用法代码示例。如果您正苦于以下问题:Python DataCollection.new_subset_group方法的具体用法?Python DataCollection.new_subset_group怎么用?Python DataCollection.new_subset_group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类glue.core.data_collection.DataCollection
的用法示例。
在下文中一共展示了DataCollection.new_subset_group方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_subset_groups_remain_synced_after_restore
# 需要导入模块: from glue.core.data_collection import DataCollection [as 别名]
# 或者: from glue.core.data_collection.DataCollection import new_subset_group [as 别名]
def test_subset_groups_remain_synced_after_restore(self):
# regrssion test for 352
d = Data(label='hist', x=[[1, 2], [2, 3]])
dc = DataCollection([d])
dc.new_subset_group()
app = GlueApplication(dc)
app2 = clone(app)
sg = app2.data_collection.subset_groups[0]
assert sg.style.parent is sg
sg.style.color = '#112233'
assert sg.subsets[0].style.color == '#112233'
示例2: test_histogram
# 需要导入模块: from glue.core.data_collection import DataCollection [as 别名]
# 或者: from glue.core.data_collection.DataCollection import new_subset_group [as 别名]
def test_histogram(self):
d = Data(label='hist', x=[[1, 2], [2, 3]])
dc = DataCollection([d])
app = GlueApplication(dc)
w = app.new_data_viewer(HistogramViewer, data=d)
self.check_clone(app)
dc.new_subset_group()
assert len(w.layers) == 2
self.check_clone(app)
w.nbins = 7
self.check_clone(app)
示例3: test_scatter_viewer
# 需要导入模块: from glue.core.data_collection import DataCollection [as 别名]
# 或者: from glue.core.data_collection.DataCollection import new_subset_group [as 别名]
def test_scatter_viewer(self):
d = Data(label='x', x=[1, 2, 3, 4, 5], y=[2, 3, 4, 5, 6])
dc = DataCollection([d])
app = GlueApplication(dc)
w = app.new_data_viewer(ScatterViewer, data=d)
copy1 = self.check_clone(app)
dc.new_subset_group()
dc.new_subset_group()
assert len(w.layers) == 3
l1, l2, l3 = w.layers
l1.zorder, l2.zorder = l2.zorder, l1.zorder
l3.visible = False
assert l3.visible is False
copy2 = self.check_clone(app)
assert copy2.viewers[0][0].layers[-1].visible is False
app.close()
copy1.close()
copy2.close()