Pregunta

Quiero hacer diagramas con tortuga de Python (con fines didácticos). Los "valores" de la etiqueta para el eje y se deben rotar.
tortuga de Python tiene un método para escribir una cadena en la posición actual:

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

"valores" es todavía horizontal.

¿Cómo puedo girar el texto con la tortuga de Python?

¿Fue útil?

Solución

It's not possible to write rotated text with turtle. See 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 http://mail.python.org/pipermail/tkinter-discuss/2010-November/002490.html) and turtle.py could be updated to take advantage of it.

Otros consejos

You CAN rotate text, but only in 8.6. Type:

pyturtle.rotate([Degrees of rotation])

Then you can do your text command. Hope this helped!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top