本文整理汇总了Python中Orange.widgets.visualize.owscatterplotgraph.OWScatterPlotGraph.update_tooltip方法的典型用法代码示例。如果您正苦于以下问题:Python OWScatterPlotGraph.update_tooltip方法的具体用法?Python OWScatterPlotGraph.update_tooltip怎么用?Python OWScatterPlotGraph.update_tooltip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orange.widgets.visualize.owscatterplotgraph.OWScatterPlotGraph
的用法示例。
在下文中一共展示了OWScatterPlotGraph.update_tooltip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OWScatterPlot
# 需要导入模块: from Orange.widgets.visualize.owscatterplotgraph import OWScatterPlotGraph [as 别名]
# 或者: from Orange.widgets.visualize.owscatterplotgraph.OWScatterPlotGraph import update_tooltip [as 别名]
#.........这里部分代码省略.........
g.JitterNumericValues], box)
self.sampling = gui.auto_commit(
self.controlArea, self, "auto_sample", "Sample", box="Sampling",
callback=self.switch_sampling, commit=lambda: self.add_data(1))
self.sampling.setVisible(False)
g.point_properties_box(self.controlArea)
self.models = [self.xy_model] + g.points_models
box_plot_prop = gui.vBox(self.controlArea, "Plot Properties")
g.add_widgets([g.ShowLegend,
g.ShowGridLines,
g.ToolTipShowsAll,
g.ClassDensity,
g.RegressionLine,
g.LabelOnlySelected], box_plot_prop)
self.graph.box_zoom_select(self.controlArea)
self.controlArea.layout().addStretch(100)
self.icons = gui.attributeIconDict
p = self.graph.plot_widget.palette()
self.graph.set_palette(p)
gui.auto_commit(self.controlArea, self, "auto_send_selection",
"Send Selection", "Send Automatically")
self.graph.zoom_actions(self)
def keyPressEvent(self, event):
super().keyPressEvent(event)
self.graph.update_tooltip(event.modifiers())
def keyReleaseEvent(self, event):
super().keyReleaseEvent(event)
self.graph.update_tooltip(event.modifiers())
def reset_graph_data(self, *_):
if self.data is not None:
self.graph.rescale_data()
self.update_graph()
def _vizrank_color_change(self):
self.vizrank.initialize()
is_enabled = self.data is not None and not self.data.is_sparse() and \
len([v for v in chain(self.data.domain.variables, self.data.domain.metas)
if v.is_primitive]) > 2\
and len(self.data) > 1
self.vizrank_button.setEnabled(
is_enabled and self.graph.attr_color is not None and
not np.isnan(self.data.get_column_view(self.graph.attr_color)[0].astype(float)).all())
if is_enabled and self.graph.attr_color is None:
self.vizrank_button.setToolTip("Color variable has to be selected.")
else:
self.vizrank_button.setToolTip("")
@Inputs.data
def set_data(self, data):
self.clear_messages()
self.Information.sampled_sql.clear()
self.__timer.stop()
self.sampling.setVisible(False)
self.sql_data = None
if isinstance(data, SqlTable):
示例2: OWScatterPlot
# 需要导入模块: from Orange.widgets.visualize.owscatterplotgraph import OWScatterPlotGraph [as 别名]
# 或者: from Orange.widgets.visualize.owscatterplotgraph.OWScatterPlotGraph import update_tooltip [as 别名]
#.........这里部分代码省略.........
self.graph.set_palette(p)
gui.auto_commit(self.controlArea, self, "auto_send_selection",
"Send Selection", "Send Automatically")
def zoom(s):
"""Zoom in/out by factor `s`."""
viewbox = plot.getViewBox()
# scaleBy scales the view's bounds (the axis range)
viewbox.scaleBy((1 / s, 1 / s))
def fit_to_view():
viewbox = plot.getViewBox()
viewbox.autoRange()
zoom_in = QAction(
"Zoom in", self, triggered=lambda: zoom(1.25)
)
zoom_in.setShortcuts([QKeySequence(QKeySequence.ZoomIn),
QKeySequence(self.tr("Ctrl+="))])
zoom_out = QAction(
"Zoom out", self, shortcut=QKeySequence.ZoomOut,
triggered=lambda: zoom(1 / 1.25)
)
zoom_fit = QAction(
"Fit in view", self,
shortcut=QKeySequence(Qt.ControlModifier | Qt.Key_0),
triggered=fit_to_view
)
self.addActions([zoom_in, zoom_out, zoom_fit])
def keyPressEvent(self, event):
super().keyPressEvent(event)
self.graph.update_tooltip(event.modifiers())
def keyReleaseEvent(self, event):
super().keyReleaseEvent(event)
self.graph.update_tooltip(event.modifiers())
# def settingsFromWidgetCallback(self, handler, context):
# context.selectionPolygons = []
# for curve in self.graph.selectionCurveList:
# xs = [curve.x(i) for i in range(curve.dataSize())]
# ys = [curve.y(i) for i in range(curve.dataSize())]
# context.selectionPolygons.append((xs, ys))
# def settingsToWidgetCallback(self, handler, context):
# selections = getattr(context, "selectionPolygons", [])
# for (xs, ys) in selections:
# c = SelectionCurve("")
# c.setData(xs,ys)
# c.attach(self.graph)
# self.graph.selectionCurveList.append(c)
def reset_graph_data(self, *_):
if self.data is not None:
self.graph.rescale_data()
self.update_graph()
@Inputs.data
def set_data(self, data):
self.clear_messages()
self.Information.sampled_sql.clear()
self.__timer.stop()
self.sampling.setVisible(False)
self.sql_data = None