繁体   English   中英

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

[英]how to rotate text in python's turtle graphics

我想用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建立在Tk之上,目前版本为8.5 - 它无法旋转文本。 当Tk版本8.6到来时它应该能够写入旋转的文本(参见http://mail.python.org/pipermail/tkinter-discuss/2010-November/002490.html )并且可以更新turtle.py以利用它。

您可以旋转文本,但仅限于8.6。 类型:

pyturtle.rotate([Degrees of rotation])

然后你可以做你的文本命令。 希望这有帮助!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM