Beispiel #1
0
    def draw(self, axis):
        PlotInfo.draw(self, axis)
        
        if self.dates:
            plotFunc = axis.plot_date
        elif self.loglog:
            plotFunc = axis.loglog
        else:
            plotFunc = axis.plot

        kwdict = {}
        kwdict["linestyle"] = self.lineStyle
        kwdict["color"] = self.color
        kwdict["label"] = self.label
        kwdict["linewidth"] = self.lineWidth
        
        if self.steps is not None:
            kwdict["drawstyle"] = "steps-%s" % (self.steps)
        
        if self.marker is not None:
            kwdict["marker"] = self.marker
            kwdict["markersize"] = self.markerSize
        else:
            kwdict["marker"] = "None"
        
        return [[plotFunc(self.xValues, self.yValues, **kwdict)], [self.label]]
Beispiel #2
0
    def __init__(self, x, y, text=None, bbox=None):
        PlotInfo.__init__(self, "label")

        self.x = x
        """
        The label's x coordinate
        """

        self.y = y
        """
        The label's y coordinate
        """

        self.text = text
        """
        The text that should be displayed with the label
        """

        self.textX = x

        self.textY = y

        self.arrow = None

        self._marker = Marker()

        self._labelProperties = LabelProperties()

        if bbox:
            self.bbox = dict(bbox)
        else:
            self.bbox = None
Beispiel #3
0
    def __init__(self, x, y, text=None, bbox=None):
        PlotInfo.__init__(self, "label")

        self.x = x
        """
        The label's x coordinate
        """

        self.y = y
        """
        The label's y coordinate
        """

        self.text = text
        """
        The text that should be displayed with the label
        """

        self.textX = x

        self.textY = y

        self.arrow = None

        self._marker = Marker()

        self._labelProperties = LabelProperties()

        if bbox:
            self.bbox = dict(bbox)
        else:
            self.bbox = None
Beispiel #4
0
 def __init__(self, x, y, text=None):
     PlotInfo.__init__(self, "label")
     
     self.x = x
     self.y = y
     self.text = text
     self.textX = x
     self.textY = y
     self.arrow = None
     self.marker = None
Beispiel #5
0
 def __init__(self):
     PlotInfo.__init__(self, "line")
     
     self.marker = None
     self.markerSize = 8.0
     # TODO Change to width
     self.lineWidth = 1
     self.color = 'black'
     self.lineStyle = '-'
     self.dates = False
     self.loglog = False
     self.steps = None
Beispiel #6
0
    def draw(self, fig, axis, transform=None):
        # Present to keep the PlotInfo sorting from failing
        self.xValues = list(itertools.repeat(0, len(self.yValues)))

        PlotInfo.draw(self, fig, axis, transform)

        kwdict = self.getAttributes()
        kwdict["linestyle"] = self.lineStyle
        kwdict["color"] = self.color
        kwdict["label"] = self.label
        kwdict["linewidth"] = self.width

        return [[axis.axhline(y=yValue, **kwdict) for yValue in self.yValues],
                [self.label for yValue in self.yValues]]
Beispiel #7
0
    def __init__(self, x, y, text=None, bbox=None):
        PlotInfo.__init__(self, "label")

        self.x = x
        self.y = y
        self.text = text
        self.textX = x
        self.textY = y
        self.arrow = None
        self._marker = Marker()
        self.rotation = None

        if bbox: self.bbox = dict(bbox)
        else: self.bbox = None
Beispiel #8
0
    def draw(self, fig, axis, transform=None):
        # Present to keep the PlotInfo sorting from failing
        self.xValues = list(itertools.repeat(0, len(self.yValues)))

        PlotInfo.draw(self, fig, axis, transform)

        kwdict = self.getAttributes()
        kwdict["linestyle"] = self.lineStyle
        kwdict["color"] = self.color
        kwdict["label"] = self.label
        kwdict["linewidth"] = self.width

        return [[axis.axhline(y=yValue, **kwdict)
                    for yValue in self.yValues],
                [self.label for yValue in self.yValues]]
Beispiel #9
0
    def draw(self, fig, axis):
        # Present to keep the PlotInfo sorting from failing
        self.yValues = [0 for x in self.xValues]

        PlotInfo.draw(self, fig, axis)

        kwdict = self.getAttributes()
        kwdict["linestyle"] = self.lineStyle
        kwdict["color"] = self.color
        kwdict["label"] = self.label
        kwdict["linewidth"] = self.width

        return [[axis.axvline(x=xValue, **kwdict)
                    for xValue in self.xValues],
                [self.label for xValue in self.xValues]]