如何在python的海龟图形中旋转文本 [英] how to rotate text in python's turtle graphics

查看:89
本文介绍了如何在python的海龟图形中旋转文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用python的海龟做图(教学目的).y 轴的标签值"应该旋转.
Python的turtle有一个方法可以在当前位置写一个字符串:

I want to make diagrams with python's turtle (teaching purposes). The label "values" for the y-axis should be rotated.
Python's turtle has a method to write a string at current position:

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

值"仍然是水平的.

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

How can I rotate text with python's turtle?

推荐答案

不能用乌龟书写旋转文本.请参阅 http://www.gossamer-threads.com/lists/python/bugs/879806:

It's not possible to write rotated text with turtle. See http://www.gossamer-threads.com/lists/python/bugs/879806:

Turtle 是建立在 Tk 之上的,Tk 目前是 8.5 版——它没有旋转文本的能力.当 Tk 8.6 版到来时,它应该能够编写旋转文本(参见 http://mail.python.org/pipermail/tkinter-discuss/2010-November/002490.html) 和turtle.py 可以更新以利用它.

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 http://mail.python.org/pipermail/tkinter-discuss/2010-November/002490.html) and turtle.py could be updated to take advantage of it.

这篇关于如何在python的海龟图形中旋转文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆