How to rotate text in python turtle graphic

I want to make python tortoise diagrams (training goals). The “value” label for the y axis should be rotated.
The Python turtle has a way to write a string at its current position:

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

"values" are still horizontal.

How can I rotate text with python turtle?

+4
source share
2 answers

It is not possible to write rotating text with a turtle. See http://www.gossamer-threads.com/lists/python/bugs/879806 :

The turtle is built on top of Tk, which is currently in version 8.5 - it has no way to rotate the 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 can be updated to use it

+3
source

You can rotate the text, but only in 8.6. A type:

 pyturtle.rotate([Degrees of rotation]) 

Then you can execute your text command. Hope this helps!

+1
source

Source: https://habr.com/ru/post/1332474/


All Articles