本文整理汇总了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())
示例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())
示例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())