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