当前位置: 首页>>代码示例>>Python>>正文


Python OWScatterPlotGraph.get_selections_as_tables方法代码示例

本文整理汇总了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:
开发者ID:justin2061,项目名称:orange3,代码行数:70,代码来源:owscatterplot.py


注:本文中的Orange.widgets.visualize.owscatterplotgraph.OWScatterPlotGraph.get_selections_as_tables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。