irrad_control/gui/widgets/plot_widgets.py
def show_data(self, curve=None, show=True):
        """Show/hide the data of curve in PlotItem. If *curve* is None, all curves are shown/hidden."""

        if not self.curves:
            raise NotImplementedError("Please define the attribute dict 'curves' and fill it with curves")

        if curve is not None and curve not in self.curves:
            logging.error('{} data not in graph. Current graphs: {}'.format(curve, ','.join(self.curves.keys())))
            return

        _curves = [curve] if curve is not None else self.curves.keys()

        for _cu in _curves:
            if show:
                if not isinstance(self.curves[_cu], pg.InfiniteLine):
                    self.legend.addItem(self.curves[_cu], _cu)
                self.plt.addItem(self.curves[_cu])
            else:
                if not isinstance(self.curves[_cu], pg.InfiniteLine):
                    self.legend.removeItem(_cu)
                self.plt.removeItem(self.curves[_cu])
Show/hide the data of curve in PlotItem. If *curve* is None, all curves are shown/hidden.
Show/hide the data of curve in PlotItem. If *curve* is None, all curves are shown/hidden.
Show / hide the data of curve in PlotItem . If * curve * is None all curves are shown / hidden .
def show_data(self, curve=None, show=True):
        if not self.curves:
            raise NotImplementedError("Please define the attribute dict 'curves' and fill it with curves")
        if curve is not None and curve not in self.curves:
            logging.error('{} data not in graph. Current graphs: {}'.format(curve, ','.join(self.curves.keys())))
            return
        _curves = [curve] if curve is not None else self.curves.keys()
        for _cu in _curves:
            if show:
                if not isinstance(self.curves[_cu], pg.InfiniteLine):
                    self.legend.addItem(self.curves[_cu], _cu)
                self.plt.addItem(self.curves[_cu])
            else:
                if not isinstance(self.curves[_cu], pg.InfiniteLine):
                    self.legend.removeItem(_cu)
                self.plt.removeItem(self.curves[_cu])
def show_data ( self , curve = None , show = True ) : if not self . curves : raise NotImplementedError ( "Please define the attribute dict 'curves' and fill it with curves" ) if curve is not None and curve not in self . curves : logging . error ( '{} data not in graph. Current graphs: {}' . format ( curve , ',' . join ( self . curves . keys ( ) ) ) ) return _curves = [ curve ] if curve is not None else self . curves . keys ( ) for _cu in _curves : if show : if not isinstance ( self . curves [ _cu ] , pg . InfiniteLine ) : self . legend . addItem ( self . curves [ _cu ] , _cu ) self . plt . addItem ( self . curves [ _cu ] ) else : if not isinstance ( self . curves [ _cu ] , pg . InfiniteLine ) : self . legend . removeItem ( _cu ) self . plt . removeItem ( self . curves [ _cu ] )
Show/hide the data of curve in PlotItem.
Show / hide the data of curve in PlotItem .
"""Show/hide the data of curve in PlotItem. If *curve* is None, all curves are shown/hidden."""
self
curve
show