本文整理汇总了Python中Orange.widgets.visualize.owscatterplotgraph.OWScatterPlotGraph.get_selections_as_tables方法的典型用法代码示例。如果您正苦于以下问题:Python OWScatterPlotGraph.get_selections_as_tables方法的具体用法?Python OWScatterPlotGraph.get_selections_as_tables怎么用?Python OWScatterPlotGraph.get_selections_as_tables使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orange.widgets.visualize.owscatterplotgraph.OWScatterPlotGraph
的用法示例。
在下文中一共展示了OWScatterPlotGraph.get_selections_as_tables方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OWScatterPlot
# 需要导入模块: from Orange.widgets.visualize.owscatterplotgraph import OWScatterPlotGraph [as 别名]
# 或者: from Orange.widgets.visualize.owscatterplotgraph.OWScatterPlotGraph import get_selections_as_tables [as 别名]
#.........这里部分代码省略.........
# self.vizrank.clearResults()
if not same_domain:
self.init_attr_values()
self.graph.inside_colors = None
self.classification_results = None
self.outlier_values = None
self.openContext(self.data)
def set_subset_data(self, subset_data):
self.subset_data = subset_data
# self.vizrank.clearArguments()
# called when all signals are received, so the graph is updated only once
def handleNewSignals(self):
self.graph.set_data(self.data, self.subset_data)
# self.vizrank.resetDialog()
if self.attribute_selection_list and \
all(attr in self.graph.attribute_name_index
for attr in self.attribute_selection_list):
self.attr_x = self.attribute_selection_list[0]
self.attr_y = self.attribute_selection_list[1]
self.attribute_selection_list = None
self.update_graph()
self.send_selections()
def set_shown_attributes(self, attributes):
if attributes and len(attributes) >= 2:
self.attribute_selection_list = attributes[:2]
else:
self.attribute_selection_list = None
def send_selections(self):
selected, unselected = \
self.graph.get_selections_as_tables(self.get_shown_attributes())
self.send("Selected Data", selected)
self.send("Other Data", unselected)
# Callback from VizRank dialog
def show_selected_attributes(self):
val = self.vizrank.get_selected_projection()
if not val:
return
if self.data.domain.class_var:
self.graph.attr_color = self.data.domain.class_var.name
self.major_graph_update(val[3])
def get_shown_attributes(self):
return self.attr_x, self.attr_y
def init_attr_values(self):
self.cb_attr_x.clear()
self.cb_attr_y.clear()
self.cb_attr_color.clear()
self.cb_attr_color.addItem("(Same color)")
self.cb_attr_label.clear()
self.cb_attr_label.addItem("(No labels)")
self.cb_attr_shape.clear()
self.cb_attr_shape.addItem("(Same shape)")
self.cb_attr_size.clear()
self.cb_attr_size.addItem("(Same size)")
if not self.data:
return
for var in self.data.domain.metas:
self.cb_attr_label.addItem(self.icons[var], var.name)
for attr in self.data.domain.variables: