本文整理汇总了Python中matplotlib.text.get_rotation函数的典型用法代码示例。如果您正苦于以下问题:Python get_rotation函数的具体用法?Python get_rotation怎么用?Python get_rotation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_rotation函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_rotation_raises
def test_get_rotation_raises():
from matplotlib import text
import sys
if sys.version_info[:2] < (2, 7):
raise SkipTest("assert_raises as context manager "
"not supported with Python < 2.7")
with assert_raises(ValueError):
text.get_rotation('hozirontal')
示例2: test_get_rotation_mod360
def test_get_rotation_mod360():
from matplotlib import text
for i, j in zip([360., 377., 720+177.2], [0., 17., 177.2]):
assert_almost_equal(text.get_rotation(i), j)
示例3: test_get_rotation_none
def test_get_rotation_none():
from matplotlib import text
assert text.get_rotation(None) == 0.0
示例4: test_get_rotation_raises
def test_get_rotation_raises():
from matplotlib import text
with assert_raises(ValueError):
text.get_rotation('hozirontal')
示例5: test_get_rotation_int
def test_get_rotation_int():
from matplotlib import text
for i in [67, 16, 41]:
assert text.get_rotation(i) == float(i)
示例6: test_get_rotation_float
def test_get_rotation_float():
from matplotlib import text
for i in [15., 16.70, 77.4]:
assert text.get_rotation(i) == i
示例7: test_get_rotation_string
def test_get_rotation_string():
from matplotlib import text
assert text.get_rotation('horizontal') == 0.
assert text.get_rotation('vertical') == 90.
assert text.get_rotation('15.') == 15.
示例8: test_get_rotation_string
def test_get_rotation_string():
from matplotlib import text
assert text.get_rotation("horizontal") == 0.0
assert text.get_rotation("vertical") == 90.0
assert text.get_rotation("15.") == 15.0