本文整理匯總了Python中matplotlib.markers.TICKDOWN屬性的典型用法代碼示例。如果您正苦於以下問題:Python markers.TICKDOWN屬性的具體用法?Python markers.TICKDOWN怎麽用?Python markers.TICKDOWN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類matplotlib.markers
的用法示例。
在下文中一共展示了markers.TICKDOWN屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: update_position
# 需要導入模塊: from matplotlib import markers [as 別名]
# 或者: from matplotlib.markers import TICKDOWN [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 TICKDOWN [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 TICKDOWN [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())