def __init__(self, x, y, errBar1=None, errBar2=None, linetype=gr.LINETYPE_SOLID, markertype=gr.MARKERTYPE_DOT, linecolor=None, markercolor=1, legend=None, fillx=0, filly=0): MaskedPlotCurve.__init__(self, x, y, errBar1, errBar2, linetype, markertype, linecolor, markercolor, legend, fillx=fillx, filly=filly) self._dependent = [] self._enableErrBars = True
def __init__(self, xlabel, ylabel, parent=None, **kwds): LiveWidget1D.__init__(self, parent) self.axes.resetCurves() self.setTitles({'x': xlabel, 'y': ylabel}) self._curves = [ MaskedPlotCurve([0], [1], linewidth=2, legend='', markertype=SOLID_CIRCLE_MARKER, markercolor=kwds.get('color2', COLOR_RED), linecolor=kwds.get('color2', COLOR_RED)), MaskedPlotCurve([0], [.1], linewidth=2, legend='', markertype=SOLID_CIRCLE_MARKER, markercolor=kwds.get('color1', COLOR_BLACK), linecolor=kwds.get('color1', COLOR_BLACK)), ] for curve in self._curves: curve.GR_MARKERSIZE = 20 self.axes.addCurves(curve) # Disable creating a mouse selection to zoom self.gr.setMouseSelectionEnabled(False) self.plot.setLegend(True)
def __init__(self, xlabel, ylabel, ncurves=1, parent=None, **kwds): LiveWidget1D.__init__(self, parent) self.axes.resetCurves() self.setTitles({'x': xlabel, 'y': ylabel}) self._curves = [ MaskedPlotCurve([0], [1], linewidth=2, legend='', linecolor=kwds.get('color1', COLOR_BLACK)), MaskedPlotCurve([0], [.1], linewidth=2, legend='', linecolor=kwds.get('color2', COLOR_GREEN)), ] for curve in self._curves[:ncurves]: self.axes.addCurves(curve) self.plot.setLegend(True) # Disable creating a mouse selection to zoom self.gr.setMouseSelectionEnabled(False)
def setPlotCount(self, count, colors): self.axes.resetCurves() self.plot.resetPlot() self._curves = [] for i in range(count): color = GRCOLORS.get(colors[i], GRCOLORS['blue']) curve = MaskedPlotCurve([0], [.1], linecolor=color) curve.markercolor = color curve.markersize = self._markersize self._curves.append(curve) self.axes.addCurves(curve) self.axes.autoscale = PlotAxes.SCALE_Y self.plot.addAxes(self.axes) self.setLines(self.hasLines) self.setSymbols(self.hasSymbols)
def __init__(self, parent): LiveWidgetBase.__init__(self, parent) self.plot._lstAxes = [] self.plot._countAxes = 0 self.curve = MaskedPlotCurve([0], [.1], linecolor=GRCOLORS['blue']) self.axes = AutoScaleAxes(self, viewport=self.plot.viewport, xdual=True) self.axes.setGrid(True) self.axes.addCurves(self.curve) self.axes.autoscale = PlotAxes.SCALE_Y self.plot.addAxes(self.axes)
def __init__(self, parent): LiveWidget.__init__(self, parent) self.plot.viewport = (0.1, 0.75, 0.1, 0.75) self.axes.viewport = self.plot.viewport self.plotyint = Plot(self, viewport=(0.1, 0.75, 0.8, 0.95)) self.axesyint = Axes(self, viewport=self.plotyint.viewport, drawX=False, drawY=True, xdual=True) self.plotxint = Plot(self, viewport=(0.8, 0.95, 0.1, 0.75)) self.axesxint = Axes(self, viewport=self.plotxint.viewport, drawX=True, drawY=False, ydual=True) vp = self.axesxint.viewport self._charheight = 0.024 * (vp[3] - vp[2]) self.axes.setXtickCallback(self.xtick) self.axesxint.setXtickCallback(self.xtick) self.axesyint.setYtickCallback(self.yinttick) self.plotyint.addAxes(self.axesyint) self.plotxint.addAxes(self.axesxint) self.curvey = MaskedPlotCurve([0], [0], filly=0.1, linecolor=GRCOLORS['blue']) self.curvex = MaskedPlotCurve([0], [0], fillx=0.1, linecolor=GRCOLORS['blue']) self.axesyint.addCurves(self.curvey) self.axesxint.addCurves(self.curvex) self.gr.addPlot(self.plotyint) self.gr.addPlot(self.plotxint)
def __init__(self, parent): LiveWidgetBase.__init__(self, parent) self.plot.resetPlot() self._curves = [MaskedPlotCurve([0], [1], linecolor=GRCOLORS['blue'])] self.axes = AutoScaleAxes(self, viewport=self.plot.viewport, xdual=True) self.axes.setGrid(True) self.axes.addCurves(self._curves[0]) self.axes.autoscale = PlotAxes.SCALE_Y self.plot.addAxes(self.axes) # self._axesrange = dict(x=(1, 1), y=(1, 1), z=(1, 1)) self.setSymbols(False) self.setLines(False) self.setMarks(['omark']) self._labels = None self._markersize = 1.0
def __init__(self, parent=None, **kwds): LiveWidget1D.__init__(self, parent) self.setTitles({'x': 'time slots', 'y': 'summed counts'}) self.axes.resetCurves() self._curves = [ MaskedPlotCurve([0], [1], linecolor=GRCOLORS['blue'], markertype=CIRCLE_MARKER, linetype=None), NicosPlotCurve([0], [.1], linecolor=COLOR_BLUE, markertype=DOT_MARKER), ] self._curves[0].markersize = 10 for curve in self._curves: self.axes.addCurves(curve) # Disable creating a mouse selection to zoom self.gr.setMouseSelectionEnabled(False)
def drawGR(self): gr.setmarkersize(self.GR_MARKER_SIZE) MaskedPlotCurve.drawGR(self) for dep in self.dependent: if dep.visible: dep.drawGR()