예제 #1
0
 def __init__(self, data, *args, **kwargs):
     Graph.__init__(self, *args, **kwargs)
     self.dataset = self.add_dataset(data)
     self.world.ymin = 0
     self.world.xmin = 0
     self.world.xmax = 10
     self.autotick()
     xLabel = LatexString(r'\6X\f{}')
     self.xaxis.label.text = xLabel
     self.autoformat()
예제 #2
0
 def __init__(self, data, *args, **kwargs):
     Graph.__init__(self, *args, **kwargs)
     self.dataset = self.add_dataset(data)
     self.world.ymin = 0
     self.world.xmin = 0
     self.world.xmax = 10
     self.autotick()
     xLabel = LatexString(r'\6X\f{}')
     self.xaxis.label.text = xLabel
     self.autoformat()
예제 #3
0
    def __init__(self, *args, **kwargs):
        Graph.__init__(self, *args, **kwargs)

        # incorporate default axes
        self.xaxis = ElAxis(self, "x")
        self.yaxis = ElAxis(self, "y")
        self.altxaxis = ElAxis(self, "x", "alt", "off")
        self.altyaxis = ElAxis(self, "x", "alt", "off")

        # set legend
        self.legend = ElLegend(self, char_size=1.0)
예제 #4
0
    def __init__(self, *args, **kwargs):
        Graph.__init__(self, *args, **kwargs)

        # incorporate default axes
        self.xaxis = ElAxis(self, 'x')
        self.yaxis = ElAxis(self, 'y')
        self.altxaxis = ElAxis(self, 'x', 'alt', 'off')
        self.altyaxis = ElAxis(self, 'x', 'alt', 'off')

        # set legend
        self.legend = ElLegend(self, char_size=1.0)
예제 #5
0
파일: metra.py 프로젝트: wenlibin02/pygrace
    def __init__(self, *args, **kwargs):
        Graph.__init__(self, *args, **kwargs)

        # incorporate default axes
        self.xaxis = MetraAxis(self,'x')
        self.yaxis = MetraAxis(self,'y')
        self.altxaxis = MetraAxis(self,'x','alt','off')
        self.altyaxis = MetraAxis(self,'x','alt','off')

        # set legend
        self.legend = MetraLegend(self)
예제 #6
0
파일: panel.py 프로젝트: wenlibin02/pygrace
    def __init__(self, panel_index=None, *args, **kwargs):
        Graph.__init__(self, *args, **kwargs)

        # find a default index for this graph
        if panel_index is None:
            if self.index is None:
                panel_index = 0
            else:
                panel_index = self.index

        # specify the default justification for the label
        self.panel_label = self.add_drawing_object(PanelLabel, panel_index)
예제 #7
0
    def __init__(self, dataList, *args, **kwargs):
        Graph.__init__(self, *args, **kwargs)

        # make graph square
        self.view.xmax = self.view.xmin + (self.view.ymax - self.view.ymin)

        # add the datasets that are given
        for index, data in enumerate(dataList):
            self.dataset = self.add_dataset(data, ScatterPoints, index + 2)

        # autoscale the axes
        self.autoscale()
예제 #8
0
    def __init__(self, dataList, *args, **kwargs):
        Graph.__init__(self, *args, **kwargs)

        # make graph square
        self.view.xmax = self.view.xmin + (self.view.ymax - self.view.ymin)

        # add the datasets that are given
        for index, data in enumerate(dataList):
            self.dataset = self.add_dataset(data, ScatterPoints, index + 2)

        # autoscale the axes
        self.autoscale()
예제 #9
0
파일: panel.py 프로젝트: mmckerns/pygrace
    def __init__(self,panel_index=None,
                 *args,**kwargs):
        Graph.__init__(self,*args,**kwargs)

        # find a default index for this graph
        if panel_index is None:
            if self.index is None:
                panel_index = 0
            else:
                panel_index = self.index

        # specify the default justification for the label
        self.panel_label = self.add_drawing_object(PanelLabel,panel_index)
예제 #10
0
    def __init__(self, bounding_box=False, *args, **kwargs):
        Graph.__init__(self, *args, **kwargs)

        self.node_xy = {}  # stores node coordinates
        self.node_sz = {}  # stores node sizes
        self.xaxis.onoff = 'off'
        self.yaxis.onoff = 'off'
        if not bounding_box:
            self.frame.linestyle = 0
        self.view.configure(xmin=0.01 * self.parent.max_canvas_width,
                            xmax=0.99 * self.parent.max_canvas_width,
                            ymin=0.01 * self.parent.max_canvas_height,
                            ymax=0.99 * self.parent.max_canvas_height)
예제 #11
0
파일: network.py 프로젝트: bjmorgan/pygrace
    def __init__(self, bounding_box=False, *args, **kwargs):
        Graph.__init__(self, *args, **kwargs)

        self.node_xy = {}  # stores node coordinates
        self.node_sz = {}  # stores node sizes
        self.xaxis.onoff='off'
        self.yaxis.onoff='off'
        if not bounding_box:
            self.frame.linestyle = 0
        self.view.configure(xmin = 0.01 * self.parent.max_canvas_width,
                            xmax = 0.99 * self.parent.max_canvas_width,
                            ymin = 0.01 * self.parent.max_canvas_height,
                            ymax = 0.99 * self.parent.max_canvas_height)
예제 #12
0
    def __init__(self,
                 domain=(),
                 scale=LINEAR_SCALE,
                 autoscale=True,
                 reverse=False,
                 color_range=(),
                 *args,
                 **kwargs):
        Graph.__init__(self, *args, **kwargs)

        # should we reverse the colors
        self.reverse = reverse

        # turn off the xaxis labels
        self.xaxis.ticklabel.onoff = "off"
        self.xaxis.tick.onoff = "off"

        # specify the scale on the yaxis
        self.set_scale(scale)

        # place labels on opposite side
        self.yaxis.ticklabel.place = 'opposite'
        self.yaxis.label.place = 'opposite'

        # make frame super skinny
        self.view.xmin = self.view.xmax - 0.1 * (self.view.ymax -
                                                 self.view.ymin)

        # remember the range of colors to be used
        if not color_range:
            if self.parent is None:
                self.color_range = []
            else:
                self.color_range = range(2, len(self.parent.colors))
                self.color_range.reverse()
        else:
            self.color_range = color_range
            self.color_range.reverse()

        # set the domain
        if domain:
            self.set_domain(domain, autoscale)
        else:
            self.set_domain((0, 1), autoscale)
예제 #13
0
    def __init__(self, domain=(), scale=LINEAR_SCALE, autoscale=True,
                 reverse=False, color_range=(), *args, **kwargs):
        Graph.__init__(self,*args,**kwargs)

        # should we reverse the colors
        self.reverse = reverse

        # turn off the xaxis labels
        self.xaxis.ticklabel.onoff = "off"
        self.xaxis.tick.onoff = "off"

        # specify the scale on the yaxis
        self.set_scale(scale)

        # place labels on opposite side
        self.yaxis.ticklabel.place = 'opposite'
        self.yaxis.label.place = 'opposite'

        # make frame super skinny
        self.view.xmin = self.view.xmax - 0.1*(self.view.ymax - self.view.ymin)

        # remember the range of colors to be used
        if not color_range:
            if self.parent is None:
                self.color_range = []
            else:
                self.color_range = range(2,len(self.parent.colors))
                self.color_range.reverse()
        else:
            self.color_range = color_range
            self.color_range.reverse()

        # set the domain
        if domain:
            self.set_domain(domain,autoscale)
        else:
            self.set_domain((0,1),autoscale)
예제 #14
0
파일: tree.py 프로젝트: wenlibin02/pygrace
    def __init__(self, parent, orientation='right', **kwargs):
        Graph.__init__(self, parent, **kwargs)

        self.labels = {}  # stores leaf labels
        for axis in [self.xaxis, self.yaxis]:
            axis.bar.onoff = 'off'
            axis.tick.onoff = 'off'

        # adjust axis properties based on orientation
        self.orientation = orientation
        if self.orientation in ['right', 'left']:
            self.xaxis.ticklabel.onoff = 'off'
            if self.orientation == 'right':
                self.yaxis.ticklabel.place = 'opposite'
        elif self.orientation in ['up', 'down']:
            self.yaxis.ticklabel.onoff = 'off'
            if self.orientation == 'up':
                self.xaxis.ticklabel.place = 'opposite'

        self.frame.linestyle = 0
        self.view.configure(xmin=0.075 * self.parent.max_canvas_width,
                            xmax=0.925 * self.parent.max_canvas_width,
                            ymin=0.075 * self.parent.max_canvas_height,
                            ymax=0.925 * self.parent.max_canvas_height)
예제 #15
0
파일: tree.py 프로젝트: bjmorgan/pygrace
    def __init__(self, parent, orientation='right', **kwargs):
        Graph.__init__(self, parent, **kwargs)
        
        self.labels = {}  # stores leaf labels
        for axis in [self.xaxis, self.yaxis]:
            axis.bar.onoff='off'
            axis.tick.onoff='off'

        # adjust axis properties based on orientation
        self.orientation = orientation
        if self.orientation in ['right','left']:
            self.xaxis.ticklabel.onoff='off'
            if self.orientation == 'right':
                self.yaxis.ticklabel.place = 'opposite'
        elif self.orientation in ['up','down']:
            self.yaxis.ticklabel.onoff='off'
            if self.orientation == 'up':
                self.xaxis.ticklabel.place = 'opposite'

        self.frame.linestyle = 0
        self.view.configure(xmin = 0.075 * self.parent.max_canvas_width,
                            xmax = 0.925 * self.parent.max_canvas_width,
                            ymin = 0.075 * self.parent.max_canvas_height,
                            ymax = 0.925 * self.parent.max_canvas_height)