Example #1
0
 def merror(self, *args, **kwargs):
     """
     Make an errorbar curve `plot item` based on MATLAB-like syntax
     (:py:class:`guiqwt.curve.ErrorBarCurveItem` object)
     
     Example::
         
         mcurve(x, y, 'r+')
     """
     x, y, dx, dy, style = self.__get_arg_triple_errorbar(args)
     basename = _("Curve")
     curveparam = CurveParam(title=basename, icon="curve.png")
     errorbarparam = ErrorBarParam(title=_("Error bars"), icon="errorbar.png")
     if "label" in kwargs:
         curveparam.label = kwargs["label"]
     else:
         global CURVE_COUNT
         CURVE_COUNT += 1
         curveparam.label = make_title(basename, CURVE_COUNT)
     update_style_attr(style, curveparam)
     errorbarparam.color = curveparam.line.color
     return self.perror(x, y, dx, dy, curveparam, errorbarparam)
Example #2
0
 def merror(self, *args, **kwargs):
     """
     Make an errorbar curve `plot item` based on MATLAB-like syntax
     (:py:class:`guiqwt.curve.ErrorBarCurveItem` object)
     
     Example::
         
         mcurve(x, y, 'r+')
     """
     x, y, dx, dy, style = self.__get_arg_triple_errorbar(args)
     basename = _("Curve")
     curveparam = CurveParam(title=basename, icon="curve.png")
     errorbarparam = ErrorBarParam(title=_("Error bars"), icon="errorbar.png")
     if "label" in kwargs:
         curveparam.label = kwargs["label"]
     else:
         global CURVE_COUNT
         CURVE_COUNT += 1
         curveparam.label = make_title(basename, CURVE_COUNT)
     update_style_attr(style, curveparam)
     errorbarparam.color = curveparam.line.color
     return self.perror(x, y, dx, dy, curveparam, errorbarparam)
Example #3
0
    def error(
        self,
        x,
        y,
        dx,
        dy,
        title="",
        color=None,
        linestyle=None,
        linewidth=None,
        errorbarwidth=None,
        errorbarcap=None,
        errorbarmode=None,
        errorbaralpha=None,
        marker=None,
        markersize=None,
        markerfacecolor=None,
        markeredgecolor=None,
        shade=None,
        curvestyle=None,
        baseline=None,
        xaxis="bottom",
        yaxis="left",
    ):
        """
        Make an errorbar curve `plot item` 
        (:py:class:`guiqwt.curve.ErrorBarCurveItem` object)

            * x: 1D NumPy array
            * y: 1D NumPy array
            * dx: None, or scalar, or 1D NumPy array
            * dy: None, or scalar, or 1D NumPy array
            * color: curve color name
            * linestyle: curve line style (MATLAB-like string or attribute name 
              from the :py:class:`PyQt4.QtCore.Qt.PenStyle` enum
              (i.e. "SolidLine" "DashLine", "DotLine", "DashDotLine", 
              "DashDotDotLine" or "NoPen")
            * linewidth: line width (pixels)
            * marker: marker shape (MATLAB-like string or attribute name from 
              the :py:class:`PyQt4.Qwt5.QwtSymbol.Style` enum (i.e. "Cross",
              "Ellipse", "Star1", "XCross", "Rect", "Diamond", "UTriangle", 
              "DTriangle", "RTriangle", "LTriangle", "Star2" or "NoSymbol")
            * markersize: marker size (pixels)
            * markerfacecolor: marker face color name
            * markeredgecolor: marker edge color name
            * shade: 0 <= float <= 1 (curve shade)
            * curvestyle: attribute name from the 
              :py:class:`PyQt4.Qwt5.QwtPlotCurve.CurveStyle` enum
              (i.e. "Lines", "Sticks", "Steps", "Dots" or "NoCurve")
            * baseline (float: default=0.0): the baseline is needed for filling 
              the curve with a brush or the Sticks drawing style. 
            * xaxis, yaxis: X/Y axes bound to curve
        
        Example::
            
            error(x, y, None, dy, marker='Ellipse', markerfacecolor='#ffffff')
        
        which is equivalent to (MATLAB-style support)::

            error(x, y, None, dy, marker='o', markerfacecolor='w')
        """
        basename = _("Curve")
        curveparam = CurveParam(title=basename, icon="curve.png")
        errorbarparam = ErrorBarParam(title=_("Error bars"), icon="errorbar.png")
        if not title:
            global CURVE_COUNT
            CURVE_COUNT += 1
            curveparam.label = make_title(basename, CURVE_COUNT)
        self.__set_param(
            curveparam,
            title,
            color,
            linestyle,
            linewidth,
            marker,
            markersize,
            markerfacecolor,
            markeredgecolor,
            shade,
            curvestyle,
            baseline,
        )
        errorbarparam.color = curveparam.line.color
        if errorbarwidth is not None:
            errorbarparam.width = errorbarwidth
        if errorbarcap is not None:
            errorbarparam.cap = errorbarcap
        if errorbarmode is not None:
            errorbarparam.mode = errorbarmode
        if errorbaralpha is not None:
            errorbarparam.alpha = errorbaralpha
        return self.perror(x, y, dx, dy, curveparam, errorbarparam, xaxis, yaxis)
Example #4
0
    def error(self, x, y, dx, dy, title="",
              color=None, linestyle=None, linewidth=None,
              errorbarwidth=None, errorbarcap=None, errorbarmode=None,
              errorbaralpha=None, marker=None, markersize=None,
              markerfacecolor=None, markeredgecolor=None, shade=None,
              curvestyle=None, baseline=None, xaxis="bottom", yaxis="left"):
        """
        Make an errorbar curve `plot item` 
        (:py:class:`guiqwt.curve.ErrorBarCurveItem` object)

            * x: 1D NumPy array
            * y: 1D NumPy array
            * dx: None, or scalar, or 1D NumPy array
            * dy: None, or scalar, or 1D NumPy array
            * color: curve color name
            * linestyle: curve line style (MATLAB-like string or attribute name 
              from the :py:class:`PyQt4.QtCore.Qt.PenStyle` enum
              (i.e. "SolidLine" "DashLine", "DotLine", "DashDotLine", 
              "DashDotDotLine" or "NoPen")
            * linewidth: line width (pixels)
            * marker: marker shape (MATLAB-like string or attribute name from 
              the :py:class:`PyQt4.Qwt5.QwtSymbol.Style` enum (i.e. "Cross",
              "Ellipse", "Star1", "XCross", "Rect", "Diamond", "UTriangle", 
              "DTriangle", "RTriangle", "LTriangle", "Star2" or "NoSymbol")
            * markersize: marker size (pixels)
            * markerfacecolor: marker face color name
            * markeredgecolor: marker edge color name
            * shade: 0 <= float <= 1 (curve shade)
            * curvestyle: attribute name from the 
              :py:class:`PyQt4.Qwt5.QwtPlotCurve.CurveStyle` enum
              (i.e. "Lines", "Sticks", "Steps", "Dots" or "NoCurve")
            * baseline (float: default=0.0): the baseline is needed for filling 
              the curve with a brush or the Sticks drawing style. 
            * xaxis, yaxis: X/Y axes bound to curve
        
        Example::
            
            error(x, y, None, dy, marker='Ellipse', markerfacecolor='#ffffff')
        
        which is equivalent to (MATLAB-style support)::

            error(x, y, None, dy, marker='o', markerfacecolor='w')
        """
        basename = _("Curve")
        curveparam = CurveParam(title=basename, icon='curve.png')
        errorbarparam = ErrorBarParam(title=_("Error bars"),
                                      icon='errorbar.png')
        if not title:
            global CURVE_COUNT
            CURVE_COUNT += 1
            curveparam.label = make_title(basename, CURVE_COUNT)
        self.__set_param(curveparam, title, color, linestyle, linewidth, marker,
                         markersize, markerfacecolor, markeredgecolor,
                         shade, curvestyle, baseline)
        errorbarparam.color = curveparam.line.color
        if errorbarwidth is not None:
            errorbarparam.width = errorbarwidth
        if errorbarcap is not None:
            errorbarparam.cap = errorbarcap
        if errorbarmode is not None:
            errorbarparam.mode = errorbarmode
        if errorbaralpha is not None:
            errorbarparam.alpha = errorbaralpha
        return self.perror(x, y, dx, dy, curveparam, errorbarparam,
                           xaxis, yaxis)