Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
 def unzoom(self):
     labels = self._labels['x']
     self._axesrange['x'] = labels[0], labels[-1]
     self._axesrange['y'] = (0.1 if self._logscale else 0,
                             max(1, self.getYMax()))
     self._zoomed = False
     LiveWidget1D.unzoom(self)
Ejemplo n.º 3
0
 def __init__(self, parent):
     LiveWidget1D.__init__(self, parent)
     self.plot.viewport = [0.02, .98, 0.1, .98]
     self.plot.xlabel = 'channel'
     self.plot.ylabel = 'counts'
     self.axes.xdual = False
     self.axes.ticksize = 0.005
Ejemplo n.º 4
0
 def __init__(self, parent):
     LiveWidget1D.__init__(self, parent)
     self.plot.viewport = [0.05, .98, 0.1, .98]
     self.plot.xlabel = 'tths (deg)'
     self.plot.ylabel = 'counts'
     self.axes.xdual = False
     self.axes.xtick = 1
     self.axes.majorx = 10
     self.axes.ticksize = 0.005
Ejemplo n.º 5
0
 def __init__(self, parent):
     LiveWidget1D.__init__(self, parent)
     self.plot.viewport = [0.05, .98, 0.1, .98]
     self.axes.xdual = False
     self.axes.xtick = 5
     self.axes.majorx = 10
     self.axes.ticksize = 0.005
     self.gr.update()
     self._zoomed = False
Ejemplo n.º 6
0
    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)
Ejemplo n.º 7
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)
Ejemplo n.º 8
0
    def __init__(self, xlabel, ylabel, ncurves=1, parent=None, **kwds):
        LiveWidget1D.__init__(self, parent)
        self.plot.xlabel = xlabel
        self.plot.ylabel = ylabel

        self.curve.linecolor = kwds.get('color1', COLOR_BLACK)
        self.curve.linewidth = 2

        if ncurves > 1:
            self.curve2 = NicosPlotCurve([0], [.1],
                                         linecolor=kwds.get(
                                             'color2', COLOR_GREEN))
            self.curve2.linewidth = 2
            self.axes.addCurves(self.curve2)
        else:
            self.curve2 = None

        # Disable creating a mouse selection to zoom
        self.gr.setMouseSelectionEnabled(False)
        self.plot.setLegend(True)
Ejemplo n.º 9
0
    def __init__(self, xlabel, ylabel, parent=None, **kwds):
        LiveWidget1D.__init__(self, parent)
        self.plot.xlabel = xlabel
        self.plot.ylabel = ylabel

        self.curve.linecolor = kwds.get('color2', COLOR_RED)
        self.curve.linewidth = 2
        self.curve.GR_MARKERSIZE = 20
        self.curve.markertype = SOLID_CIRCLE_MARKER
        self.curve.markercolor = kwds.get('color2', COLOR_RED)

        self.downcurve = NicosPlotCurve(
            [0], [.1], linecolor=kwds.get('color1', COLOR_BLACK))
        self.downcurve.linewidth = 2
        self.downcurve.markertype = SOLID_CIRCLE_MARKER
        self.downcurve.GR_MARKERSIZE = 20
        self.downcurve.markertype = SOLID_CIRCLE_MARKER
        self.downcurve.markercolor = kwds.get('color1', COLOR_BLACK)
        self.axes.addCurves(self.downcurve)

        # Disable creating a mouse selection to zoom
        self.gr.setMouseSelectionEnabled(False)
        self.plot.setLegend(True)
Ejemplo n.º 10
0
 def __init__(self, parent):
     BaseLiveWidget1D.__init__(self, parent)
     self.plot.viewport = [0.1, .95, 0.1, .85]
Ejemplo n.º 11
0
 def __init__(self, name='', parent=None):
     DefaultLiveWidget1D.__init__(self, parent)
     self.setMinimumSize(150, 150)
     self.name = name
Ejemplo n.º 12
0
 def __init__(self, parent=None):
     LiveWidget1D.__init__(self, parent)
     self.axes.xdual = False
Ejemplo n.º 13
0
 def select(self, master, p0, p1):
     LiveWidget1D.select(self, master, p0, p1)
     if self.plot == master:
         self._zoomed = True
         self._axesrange['x'] = self.axes.getWindow()[:2]
         self._axesrange['y'] = self.axes.getWindow()[2:]
Ejemplo n.º 14
0
 def zoom(self, master, dpercent, p0):
     LiveWidget1D.zoom(self, master, dpercent, p0)
     if self.plot == master:
         self._zoomed = True
         self._axesrange['x'] = self.axes.getWindow()[:2]
         self._axesrange['y'] = self.axes.getWindow()[2:]
Ejemplo n.º 15
0
 def _adjustYAxisRange(self):
     if not self._zoomed:
         LiveWidget1D._adjustYAxisRange(self)