pyqtgraphRedefine¶
Module Contents¶
Classes¶
Attributes¶
-
isOnWindows¶ Other modified files (directly): ScatterPlotItem.py, to change point selection. Ctrl + clic: select area. Clic: only one single point:
- class OnClicSelector:
- def __init__(self):
- self.p_list = []
- def add_point(self, newp):
- self.p_list.append(newp)
- def draw(self, painter):
- if len(self.p_list) > 2:
- pen = fn.mkPen(1) pen.setWidthF(2) painter.setPen(pen) painter.drawPolyline(QtGui.QPolygonF(self.p_list))
- def reset(self):
- self.p_list = []
- def getPath(self):
- return path.Path([(p.x(), p.y()) for p in self.p_list] + [(self.p_list[-1].x(), self.p_list[-1].y())])
- def mouseDragEvent(self, ev):
- if ev.modifiers() and QtCore.Qt.ControlModifier:
ev.accept() self.clicSelector.add_point(ev.pos()) if ev.isFinish():
path = self.clicSelector.getPath() points = self.points() contains_points = path.contains_points([(p.pos().x(), p.pos().y()) for p in points]) indices = [i for i, cond in enumerate(contains_points) if cond] points_clicked = [points[i] for i in indices] self.ptsClicked = points_clicked self.sigClicked.emit(self, self.ptsClicked) self.clicSelector.reset()self.update()
- else:
- ev.ignore()
-
class
myGraphicsLayoutWidget(parent=None, **_kwargs)[source]¶ Bases:
optimeed.visualize.graphs.pyqtgraph.GraphicsViewRe-implementation of QGraphicsView that removes scrollbars and allows unambiguous control of the viewed coordinate range. Also automatically creates a GraphicsScene and a central QGraphicsWidget that is automatically scaled to the full view geometry.
This widget is the basis for
PlotWidget,GraphicsLayoutWidget, and the view widget inImageView.By default, the view coordinate system matches the widget’s pixel coordinates and automatically updates when the view is resized. This can be overridden by setting autoPixelRange=False. The exact visible range can be set with setRange().
The view can be panned using the middle mouse button and scaled using the right mouse button if enabled via enableMouse() (but ordinarily, we use ViewBox for this functionality).
-
class
myGraphicsLayout[source]¶ Bases:
optimeed.visualize.graphs.pyqtgraph.GraphicsLayoutUsed for laying out GraphicsWidgets in a grid. This is usually created automatically as part of a
GraphicsWindoworGraphicsLayoutWidget.
-
class
myItemSample(item)[source]¶ Bases:
optimeed.visualize.graphs.pyqtgraph.graphicsItems.LegendItem.ItemSampleClass responsible for drawing a single item in a LegendItem (sans label)
-
class
myLegend(size=None, offset=(30, 30), is_light=False)[source]¶ Bases:
optimeed.visualize.graphs.pyqtgraph.LegendItemLegend that fixes bugs (flush left + space) from pyqtgraph’s legend
-
class
myLabelItem(text=' ', parent=None, angle=0, **args)[source]¶ Bases:
optimeed.visualize.graphs.pyqtgraph.LabelItemGraphicsWidget displaying text. Used mainly as axis labels, titles, etc.
Note: To display text inside a scaled view (ViewBox, PlotWidget, etc) use TextItem
-
class
myAxis(orientation)[source]¶ Bases:
optimeed.visualize.graphs.pyqtgraph.AxisItemGraphicsItem showing a single plot axis with ticks, values, and label. Can be configured to fit on any side of a plot, Can automatically synchronize its displayed scale with ViewBox items. Ticks can be extended to draw a grid. If maxTickLength is negative, ticks point into the plot.
-
update_label¶
-