当前位置: 首页>>代码示例>>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;未经允许,请勿转载。