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


Python matplotlib.spines方法代碼示例

本文整理匯總了Python中matplotlib.spines方法的典型用法代碼示例。如果您正苦於以下問題:Python matplotlib.spines方法的具體用法?Python matplotlib.spines怎麽用?Python matplotlib.spines使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在matplotlib的用法示例。


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

示例1: get_xaxis_transform

# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import spines [as 別名]
def get_xaxis_transform(self, which='grid'):
        """
        Get the transformation used for drawing x-axis labels, ticks
        and gridlines.  The x-direction is in data coordinates and the
        y-direction is in axis coordinates.

        .. note::

            This transformation is primarily used by the
            :class:`~matplotlib.axis.Axis` class, and is meant to be
            overridden by new kinds of projections that may need to
            place axis elements in different locations.

        """
        if which == 'grid':
            return self._xaxis_transform
        elif which == 'tick1':
            # for cartesian projection, this is bottom spine
            return self.spines['bottom'].get_spine_transform()
        elif which == 'tick2':
            # for cartesian projection, this is top spine
            return self.spines['top'].get_spine_transform()
        else:
            raise ValueError('unknown value for which') 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:26,代碼來源:_base.py

示例2: get_yaxis_transform

# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import spines [as 別名]
def get_yaxis_transform(self, which='grid'):
        """
        Get the transformation used for drawing y-axis labels, ticks
        and gridlines.  The x-direction is in axis coordinates and the
        y-direction is in data coordinates.

        .. note::

            This transformation is primarily used by the
            :class:`~matplotlib.axis.Axis` class, and is meant to be
            overridden by new kinds of projections that may need to
            place axis elements in different locations.

        """
        if which == 'grid':
            return self._yaxis_transform
        elif which == 'tick1':
            # for cartesian projection, this is bottom spine
            return self.spines['left'].get_spine_transform()
        elif which == 'tick2':
            # for cartesian projection, this is top spine
            return self.spines['right'].get_spine_transform()
        else:
            raise ValueError('unknown value for which') 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:26,代碼來源:_base.py

示例3: get_children

# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import spines [as 別名]
def get_children(self):
        """return a list of child artists"""
        children = []
        children.extend(self.collections)
        children.extend(self.patches)
        children.extend(self.lines)
        children.extend(self.texts)
        children.extend(self.artists)
        children.extend(self.spines.values())
        children.append(self.xaxis)
        children.append(self.yaxis)
        children.append(self.title)
        children.append(self._left_title)
        children.append(self._right_title)
        children.extend(self.tables)
        children.extend(self.images)
        children.extend(self.child_axes)

        if self.legend_ is not None:
            children.append(self.legend_)
        children.append(self.patch)

        return children 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:25,代碼來源:_base.py

示例4: adjust_spines

# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import spines [as 別名]
def adjust_spines(ax,spines):
    for loc, spine in ax.spines.items():
        if loc in spines:
            spine.set_position(('outward',10)) # outward by 10 points
        else:
            spine.set_color('none') # don't draw spine

    # turn off ticks where there is no spine
    if 'left' in spines:
        ax.yaxis.set_ticks_position('left')
    else:
        # no yaxis ticks
        ax.yaxis.set_ticks([])

    if 'bottom' in spines:
        ax.xaxis.set_ticks_position('bottom')
    else:
        # no xaxis ticks
        ax.xaxis.set_ticks([]) 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:21,代碼來源:whats_new_99_spines.py

示例5: get_children

# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import spines [as 別名]
def get_children(self):
        """return a list of child artists"""
        children = []
        children.extend(self.collections)
        children.extend(self.patches)
        children.extend(self.lines)
        children.extend(self.texts)
        children.extend(self.artists)
        children.extend(six.itervalues(self.spines))
        children.append(self.xaxis)
        children.append(self.yaxis)
        children.append(self.title)
        children.append(self._left_title)
        children.append(self._right_title)
        children.extend(self.tables)
        children.extend(self.images)
        if self.legend_ is not None:
            children.append(self.legend_)
        children.append(self.patch)
        return children 
開發者ID:alvarobartt,項目名稱:twitter-stock-recommendation,代碼行數:22,代碼來源:_base.py

示例6: _init_axis

# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import spines [as 別名]
def _init_axis(self):
        self.xaxis = maxis.XAxis(self)
        self.yaxis = maxis.YAxis(self)
        # Do not register xaxis or yaxis with spines -- as done in
        # Axes._init_axis() -- until GeoAxes.xaxis.cla() works.
        # self.spines['geo'].register_axis(self.yaxis)
        self._update_transScale() 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:9,代碼來源:geo.py

示例7: _init_axis

# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import spines [as 別名]
def _init_axis(self):
        "move this out of __init__ because non-separable axes don't use it"
        self.xaxis = maxis.XAxis(self)
        self.yaxis = maxis.YAxis(self)
        # Calling polar_axes.xaxis.cla() or polar_axes.xaxis.cla()
        # results in weird artifacts. Therefore we disable this for
        # now.
        # self.spines['polar'].register_axis(self.yaxis)
        self._update_transScale() 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:11,代碼來源:polar.py

示例8: _init_axis

# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import spines [as 別名]
def _init_axis(self):
        "move this out of __init__ because non-separable axes don't use it"
        self.xaxis = maxis.XAxis(self)
        self.spines['bottom'].register_axis(self.xaxis)
        self.spines['top'].register_axis(self.xaxis)
        self.yaxis = maxis.YAxis(self)
        self.spines['left'].register_axis(self.yaxis)
        self.spines['right'].register_axis(self.yaxis)
        self._update_transScale() 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:11,代碼來源:_base.py

示例9: _adjust_location

# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import spines [as 別名]
def _adjust_location(self):
        pts = self._path.vertices
        if self.spine_type == 'top':
            pts[:, 0] = self.axes.upper_xlim
        else:
            pts[:, 0] = self.axes.lower_xlim


# This class handles registration of the skew-xaxes as a projection as well
# as setting up the appropriate transformations. It also overrides standard
# spines and axes instances as appropriate. 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:13,代碼來源:skewt.py

示例10: _init_axis

# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import spines [as 別名]
def _init_axis(self):
        # Taken from Axes and modified to use our modified X-axis
        self.xaxis = SkewXAxis(self)
        self.spines['top'].register_axis(self.xaxis)
        self.spines['bottom'].register_axis(self.xaxis)
        self.yaxis = maxis.YAxis(self)
        self.spines['left'].register_axis(self.yaxis)
        self.spines['right'].register_axis(self.yaxis) 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:10,代碼來源:skewt.py

示例11: _gen_axes_spines

# 需要導入模塊: import matplotlib [as 別名]
# 或者: from matplotlib import spines [as 別名]
def _gen_axes_spines(self):
        spines = {'top': SkewSpine.linear_spine(self, 'top'),
                  'bottom': mspines.Spine.linear_spine(self, 'bottom'),
                  'left': mspines.Spine.linear_spine(self, 'left'),
                  'right': mspines.Spine.linear_spine(self, 'right')}
        return spines 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:8,代碼來源:skewt.py


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