当前位置: 首页>>代码示例>>Python>>正文


Python markers.TICKUP属性代码示例

本文整理汇总了Python中matplotlib.markers.TICKUP属性的典型用法代码示例。如果您正苦于以下问题:Python markers.TICKUP属性的具体用法?Python markers.TICKUP怎么用?Python markers.TICKUP使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在matplotlib.markers的用法示例。


在下文中一共展示了markers.TICKUP属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: update_position

# 需要导入模块: from matplotlib import markers [as 别名]
# 或者: from matplotlib.markers import TICKUP [as 别名]
def update_position(self, loc):
        super().update_position(loc)
        axes = self.axes
        angle = loc * axes.get_theta_direction() + axes.get_theta_offset()
        text_angle = np.rad2deg(angle) % 360 - 90
        angle -= np.pi / 2

        marker = self.tick1line.get_marker()
        if marker in (mmarkers.TICKUP, '|'):
            trans = mtransforms.Affine2D().scale(1, 1).rotate(angle)
        elif marker == mmarkers.TICKDOWN:
            trans = mtransforms.Affine2D().scale(1, -1).rotate(angle)
        else:
            # Don't modify custom tick line markers.
            trans = self.tick1line._marker._transform
        self.tick1line._marker._transform = trans

        marker = self.tick2line.get_marker()
        if marker in (mmarkers.TICKUP, '|'):
            trans = mtransforms.Affine2D().scale(1, 1).rotate(angle)
        elif marker == mmarkers.TICKDOWN:
            trans = mtransforms.Affine2D().scale(1, -1).rotate(angle)
        else:
            # Don't modify custom tick line markers.
            trans = self.tick2line._marker._transform
        self.tick2line._marker._transform = trans

        mode, user_angle = self._labelrotation
        if mode == 'default':
            text_angle = user_angle
        else:
            if text_angle > 90:
                text_angle -= 180
            elif text_angle < -90:
                text_angle += 180
            text_angle += user_angle
        self.label1.set_rotation(text_angle)
        self.label2.set_rotation(text_angle)

        # This extra padding helps preserve the look from previous releases but
        # is also needed because labels are anchored to their center.
        pad = self._pad + 7
        self._update_padding(pad,
                             self._loc * axes.get_theta_direction() +
                             axes.get_theta_offset()) 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:47,代码来源:polar.py

示例2: update_position

# 需要导入模块: from matplotlib import markers [as 别名]
# 或者: from matplotlib.markers import TICKUP [as 别名]
def update_position(self, loc):
        super().update_position(loc)
        axes = self.axes
        angle = loc * axes.get_theta_direction() + axes.get_theta_offset()
        text_angle = np.rad2deg(angle) % 360 - 90
        angle -= np.pi / 2

        if self.tick1On:
            marker = self.tick1line.get_marker()
            if marker in (mmarkers.TICKUP, '|'):
                trans = mtransforms.Affine2D().scale(1.0, 1.0).rotate(angle)
            elif marker == mmarkers.TICKDOWN:
                trans = mtransforms.Affine2D().scale(1.0, -1.0).rotate(angle)
            else:
                # Don't modify custom tick line markers.
                trans = self.tick1line._marker._transform
            self.tick1line._marker._transform = trans
        if self.tick2On:
            marker = self.tick2line.get_marker()
            if marker in (mmarkers.TICKUP, '|'):
                trans = mtransforms.Affine2D().scale(1.0, 1.0).rotate(angle)
            elif marker == mmarkers.TICKDOWN:
                trans = mtransforms.Affine2D().scale(1.0, -1.0).rotate(angle)
            else:
                # Don't modify custom tick line markers.
                trans = self.tick2line._marker._transform
            self.tick2line._marker._transform = trans

        mode, user_angle = self._labelrotation
        if mode == 'default':
            text_angle = user_angle
        else:
            if text_angle > 90:
                text_angle -= 180
            elif text_angle < -90:
                text_angle += 180
            text_angle += user_angle
        if self.label1On:
            self.label1.set_rotation(text_angle)
        if self.label2On:
            self.label2.set_rotation(text_angle)

        # This extra padding helps preserve the look from previous releases but
        # is also needed because labels are anchored to their center.
        pad = self._pad + 7
        self._update_padding(pad,
                             self._loc * axes.get_theta_direction() +
                             axes.get_theta_offset()) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:50,代码来源:polar.py

示例3: update_position

# 需要导入模块: from matplotlib import markers [as 别名]
# 或者: from matplotlib.markers import TICKUP [as 别名]
def update_position(self, loc):
        super(ThetaTick, self).update_position(loc)
        axes = self.axes
        angle = loc * axes.get_theta_direction() + axes.get_theta_offset()
        text_angle = np.rad2deg(angle) % 360 - 90
        angle -= np.pi / 2

        if self.tick1On:
            marker = self.tick1line.get_marker()
            if marker in (mmarkers.TICKUP, '|'):
                trans = mtransforms.Affine2D().scale(1.0, 1.0).rotate(angle)
            elif marker == mmarkers.TICKDOWN:
                trans = mtransforms.Affine2D().scale(1.0, -1.0).rotate(angle)
            else:
                # Don't modify custom tick line markers.
                trans = self.tick1line._marker._transform
            self.tick1line._marker._transform = trans
        if self.tick2On:
            marker = self.tick2line.get_marker()
            if marker in (mmarkers.TICKUP, '|'):
                trans = mtransforms.Affine2D().scale(1.0, 1.0).rotate(angle)
            elif marker == mmarkers.TICKDOWN:
                trans = mtransforms.Affine2D().scale(1.0, -1.0).rotate(angle)
            else:
                # Don't modify custom tick line markers.
                trans = self.tick2line._marker._transform
            self.tick2line._marker._transform = trans

        mode, user_angle = self._labelrotation
        if mode == 'default':
            text_angle = user_angle
        else:
            if text_angle > 90:
                text_angle -= 180
            elif text_angle < -90:
                text_angle += 180
            text_angle += user_angle
        if self.label1On:
            self.label1.set_rotation(text_angle)
        if self.label2On:
            self.label2.set_rotation(text_angle)

        # This extra padding helps preserve the look from previous releases but
        # is also needed because labels are anchored to their center.
        pad = self._pad + 7
        self._update_padding(pad,
                             self._loc * axes.get_theta_direction() +
                             axes.get_theta_offset()) 
开发者ID:alvarobartt,项目名称:twitter-stock-recommendation,代码行数:50,代码来源:polar.py


注:本文中的matplotlib.markers.TICKUP属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。