當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。