编程语言
首页 > 编程语言> > 如何在python的乌龟图形中旋转文本

如何在python的乌龟图形中旋转文本

作者:互联网

我想用python的乌龟制作图表(教学目的).应旋转y轴的标签“值”.
Python的乌龟有一种在当前位置写一个字符串的方法:

from turtle import *
left(90) # does not help
write("values", font=('Arial', 12, 'normal'))
hideturtle()
mainloop()

“价值”仍然是水平的.

如何用python的乌龟旋转文本?

解决方法:

用乌龟写旋转的文字是不可能的.见http://www.gossamer-threads.com/lists/python/bugs/879806

Turtle is built on top of Tk, which is currently at version 8.5 – this has no ability to rotate text. When Tk version 8.6 arrives it should be able to write rotated text (see 07001) and turtle.py could be updated to take advantage of it.

标签:python,python-3-x,turtle-graphics
来源: https://codeday.me/bug/20190626/1297891.html