Beispiel #1
0
def _errorBarsDiamondFilled(style, xmin, xmax, ymin, ymax, xplotter, yplotter,
                            s, painter, clip):
    """Draw diamond filled region inside error bars."""
    if None not in (xmin, xmax, ymin, ymax):
        if not s.FillBelow.hideerror:
            path = qt4.QPainterPath()
            utils.addNumpyPolygonToPath(path, clip, xmin, yplotter, xplotter,
                                        ymin, xmax, yplotter)
            utils.brushExtFillPath(painter, s.FillBelow, path, ignorehide=True)

        if not s.FillAbove.hideerror:
            path = qt4.QPainterPath()
            utils.addNumpyPolygonToPath(path, clip, xmin, yplotter, xplotter,
                                        ymax, xmax, yplotter)
            utils.brushExtFillPath(painter, s.FillAbove, path, ignorehide=True)
Beispiel #2
0
def _errorBarsDiamond(style, xmin, xmax, ymin, ymax, xplotter, yplotter,
                      s, painter, clip):
    """Draw diamond around error region."""
    if None not in (xmin, xmax, ymin, ymax):

        # expand clip by pen width (urgh)
        pw = painter.pen().widthF()*2
        clip = qt4.QRectF(qt4.QPointF(clip.left()-pw,clip.top()-pw),
                          qt4.QPointF(clip.right()+pw,clip.bottom()+pw))

        path = qt4.QPainterPath()
        utils.addNumpyPolygonToPath(path, clip,
                                    xmin, yplotter, xplotter, ymax,
                                    xmax, yplotter, xplotter, ymin)
        painter.setBrush( qt4.QBrush() )
        painter.drawPath(path)
Beispiel #3
0
def _errorBarsDiamond(style, xmin, xmax, ymin, ymax, xplotter, yplotter, s,
                      painter, clip):
    """Draw diamond around error region."""
    if None not in (xmin, xmax, ymin, ymax):

        # expand clip by pen width (urgh)
        pw = painter.pen().widthF() * 2
        clip = qt4.QRectF(qt4.QPointF(clip.left() - pw,
                                      clip.top() - pw),
                          qt4.QPointF(clip.right() + pw,
                                      clip.bottom() + pw))

        path = qt4.QPainterPath()
        utils.addNumpyPolygonToPath(path, clip, xmin, yplotter, xplotter, ymax,
                                    xmax, yplotter, xplotter, ymin)
        painter.setBrush(qt4.QBrush())
        painter.drawPath(path)
Beispiel #4
0
def _errorBarsDiamondFilled(style, xmin, xmax, ymin, ymax, xplotter, yplotter,
                            s, painter, clip):
    """Draw diamond filled region inside error bars."""
    if None not in (xmin, xmax, ymin, ymax):
        if not s.FillBelow.hideerror:
            path = qt4.QPainterPath()
            utils.addNumpyPolygonToPath(path, clip,
                                        xmin, yplotter, xplotter, ymin,
                                        xmax, yplotter)
            utils.brushExtFillPath(painter, s.FillBelow, path, ignorehide=True)

        if not s.FillAbove.hideerror:
            path = qt4.QPainterPath()
            utils.addNumpyPolygonToPath(path, clip,
                                        xmin, yplotter, xplotter, ymax,
                                        xmax, yplotter)
            utils.brushExtFillPath(painter, s.FillAbove, path, ignorehide=True)
Beispiel #5
0
    def plotBars(self, painter, s, dsnum, clip, corners):
        """Plot a set of boxes."""
        # get style
        brush = s.BarFill.get('fills').returnBrushExtended(dsnum)
        pen = s.BarLine.get('lines').makePen(painter, dsnum)
        lw = pen.widthF() * 2

        # make clip box bigger to avoid lines showing
        extclip = qt4.QRectF(qt4.QPointF(clip.left()-lw, clip.top()-lw),
                             qt4.QPointF(clip.right()+lw, clip.bottom()+lw))

        # plot bars
        path = qt4.QPainterPath()
        utils.addNumpyPolygonToPath(
            path, extclip, corners[0], corners[1], corners[2], corners[1],
            corners[2], corners[3], corners[0], corners[3])
        utils.brushExtFillPath(painter, brush, path, stroke=pen)
Beispiel #6
0
    def plotBars(self, painter, s, dsnum, clip, corners):
        """Plot a set of boxes."""
        # get style
        brush = s.BarFill.get('fills').returnBrushExtended(dsnum)
        pen = s.BarLine.get('lines').makePen(painter, dsnum)
        lw = pen.widthF() * 2

        # make clip box bigger to avoid lines showing
        extclip = qt4.QRectF(
            qt4.QPointF(clip.left() - lw,
                        clip.top() - lw),
            qt4.QPointF(clip.right() + lw,
                        clip.bottom() + lw))

        # plot bars
        path = qt4.QPainterPath()
        utils.addNumpyPolygonToPath(path, extclip, corners[0], corners[1],
                                    corners[2], corners[1], corners[2],
                                    corners[3], corners[0], corners[3])
        utils.brushExtFillPath(painter, brush, path, stroke=pen)
Beispiel #7
0
def _errorBarsBoxFilled(style, xmin, xmax, ymin, ymax, xplotter, yplotter,
                        s, painter, clip):
    """Draw box filled region inside error bars."""
    print "_errorBarsBoxFilled"
    print xplotter
    print yplotter
    if None not in (xmin, xmax, ymin, ymax):
        # filled region below
        if not s.FillBelow.hideerror:
            path = qt4.QPainterPath()
            utils.addNumpyPolygonToPath(path, clip,
                                        xmin, ymin, xmin, yplotter,
                                        xmax, yplotter, xmax, ymin)
            utils.brushExtFillPath(painter, s.FillBelow, path, ignorehide=True)

        # filled region above
        if not s.FillAbove.hideerror:
            path = qt4.QPainterPath()
            utils.addNumpyPolygonToPath(path, clip,
                                        xmin, yplotter, xmax, yplotter,
                                        xmax, ymax, xmin, ymax)
            utils.brushExtFillPath(painter, s.FillAbove, path, ignorehide=True)