예제 #1
0
파일: Line.py 프로젝트: crazyideas21/dev
    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]]
예제 #2
0
파일: Label.py 프로젝트: alexras/boomslang
    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
예제 #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
예제 #4
0
파일: Label.py 프로젝트: crazyideas21/dev
 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
예제 #5
0
파일: Line.py 프로젝트: crazyideas21/dev
 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
예제 #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]]
예제 #7
0
파일: Label.py 프로젝트: jcmdev0/boomslang
    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
예제 #8
0
파일: HLine.py 프로젝트: alexras/boomslang
    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]]
예제 #9
0
파일: VLine.py 프로젝트: jcmdev0/boomslang
    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]]