當前位置: 首頁>>代碼示例>>Python>>正文


Python base.GraceObject類代碼示例

本文整理匯總了Python中base.GraceObject的典型用法代碼示例。如果您正苦於以下問題:Python GraceObject類的具體用法?Python GraceObject怎麽用?Python GraceObject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了GraceObject類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    def __init__(self, parent, attrs, *args, **kwargs):
        GraceObject.__init__(self, parent, attrs, *args, **kwargs)

        # these are needed for the parent checking by drawing objects, but
        # should not be imported everything else has been (to avoid a cycle
        # in the dependency graph)
        import graph
        import grace

        # if the drawing object is added by a Graph, then record the index of
        # the graph.  Otherwise the parent of the drawing object is the grace.
        # The case in which self.parent = None occurs when Base.copy_format
        # is used with a DrawingObject subclass.  In this case, since there
        # is no instance to associate with a graph (or not), then the drawing
        # object is linked to the grace (not any particular graph)
        if isinstance(self.parent, grace.Grace):
            self._linked_graph = None
        elif isinstance(self.parent, graph.Graph):
            self._linked_graph = self.parent.index
        elif self.parent == None:
            self._linked_graph = None            
        else:
            message = 'parent of drawing object (%s) is not graph or grace.' %\
                      type(self.parent)
            raise TypeError(message)
開發者ID:bjmorgan,項目名稱:pygrace,代碼行數:25,代碼來源:drawing_objects.py

示例2: __init__

    def __init__(self,
                 width=792,
                 height=612,
		 background_color=0,
                 background_fill='off',
                 version='50114',
                 verbose=False,
                 colors=None,
                 **kwargs
		 ): 
        GraceObject.__init__(self, None, locals())

	self.timestamp = Timestamp(self)

        # set these first, so that children inherit this color scheme
        self.colors = colors or DefaultColorScheme()
        self.fonts = default_fonts

        self._graphIndex = INDEX_ORIGIN
	self.graphs = []

        self.drawing_objects = []
        
        # maximum frame ratios in viewport units
        self.get_canvas_dimensions()
開發者ID:mmckerns,項目名稱:pygrace,代碼行數:25,代碼來源:grace.py

示例3: __setattr__

    def __setattr__(self, key, value):

        # check type of Frame specific attribute
        if key == 'type':
            self._check_type(int, key, value)
            self._check_range(key, value, 0, 6, includeMax=False)
        GraceObject.__setattr__(self, key, value)
開發者ID:mmckerns,項目名稱:pygrace,代碼行數:7,代碼來源:graph.py

示例4: __init__

 def __init__(self, parent,
              xmin=0.15,
              xmax=1.15,
              ymin=0.15,
              ymax=0.85,
              **kwargs
              ):
     GraceObject.__init__(self, parent, locals())
開發者ID:mmckerns,項目名稱:pygrace,代碼行數:8,代碼來源:graph.py

示例5: __init__

 def __init__(self, parent,
              type = 0,
              rule = 0,
              color = 1,
              pattern = 1,
              **kwargs
              ):
     GraceObject.__init__(self, parent, locals())
開發者ID:bjmorgan,項目名稱:pygrace,代碼行數:8,代碼來源:dataset.py

示例6: __init__

 def __init__(self, parent, data, index, type="xy", hidden="false", dropline="off", comment="", legend="", **kwargs):
     GraceObject.__init__(self, parent, locals())
     self.baseline = Baseline(self)
     self.symbol = Symbol(self)
     self.line = Line(self)
     self.fill = Fill(self)
     self.avalue = AnnotatedValue(self)
     self.errorbar = ErrorBar(self)
開發者ID:nonAbelianDucks,項目名稱:pygrace,代碼行數:8,代碼來源:dataset.py

示例7: __setattr__

    def __setattr__(self, key, value):

        # check Fill specific attributes
        if key == 'type':
            self._check_type(int, key, value)
            self._check_range(key, value, 0, 2)
        elif key == 'rule':
            self._check_type(int, key, value)
            self._check_range(key, value, 0, 1)
            
        GraceObject.__setattr__(self, key, value)
開發者ID:bjmorgan,項目名稱:pygrace,代碼行數:11,代碼來源:dataset.py

示例8: __init__

 def __init__(self, parent,
              onoff='off',
              x = 0.03,
              y = 0.03,
              color = 1,
              font = 4,
              rot = 0,
              char_size = 1.0,
              **kwargs
              ):
     GraceObject.__init__(self, parent, locals())
開發者ID:bjmorgan,項目名稱:pygrace,代碼行數:11,代碼來源:grace.py

示例9: __setattr__

    def __setattr__(self, key, value):

        # check Grace specific attributes
        if key == 'width' or key == 'height':
            self._check_type(int, key, value)
            self._check_range(key, value, 0, None)
        elif key == 'verbose':
            self._check_type(bool, key, value)
        elif key == 'version':
            self._check_type(str, key, value)
        elif key == 'background_fill':
            self._check_type(str, key, value)
            self._check_membership(key, value, ('on', 'off'))
            
        GraceObject.__setattr__(self, key, value)
開發者ID:bjmorgan,項目名稱:pygrace,代碼行數:15,代碼來源:grace.py

示例10: __setattr__

    def __setattr__(self, key, value):

        # check Graph specific attributes
        if key == 'start' or key == 'end':
            self._check_type(tuple, key, value)
        elif key == 'arrow':
            self._check_type(int, key, value)
            self._check_range(key, value, 0, 3)
        elif key == 'arrow_type':
            self._check_type(int, key, value)
            self._check_range(key, value, 0, 2)
        elif key == 'arrow_length':
            self._check_type((float, int), key, value)
            self._check_range(key, value, 0, None)
        elif key == 'arrow_layout':
            self._check_type(tuple, key, value)
            self._check_range(key, value[0], 0, None)
            self._check_range(key, value[1], 0, 1, includeMax=True)
            
        GraceObject.__setattr__(self, key, value)
開發者ID:bjmorgan,項目名稱:pygrace,代碼行數:20,代碼來源:drawing_objects.py


注:本文中的base.GraceObject類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。