0

How do I zoom out on the canvas so I'll be able to see everything that is drawn from the turtle in Python. As the name suggests, I use the Turtle from Python to draw a binary tree of certain strings. I could of course force the turtle to draw more narrowly, but then the leaves would be too close to each other. That's why I'm looking for an option to zoom out on the thee when the turtle is done with its drawings.

The screenshot below should show my frustration. As you can see, it is not possible for me to see the whole binary tree.

enter image description here

Have not included the whole code. But let me know if you want to see it. Here is a snippet though.

import turtle
turtle.screensize(5000, 3000)
t = turtle.Turtle()
t.hideturtle()
t.speed(0); turtle.delay(0)
h = height(root)
jumpto(0, 30*h)
draw(root, 0, 30*h, 40*h) #function to draw
t.hideturtle()
turtle.mainloop()
Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
GoldenRetriever
  • 155
  • 3
  • 11
  • Does this answer your question? [Python imaging, resize Turtle Graphics window](https://stackoverflow.com/questions/831894/python-imaging-resize-turtle-graphics-window) – Tomerikoo Feb 03 '21 at 14:29
  • I'm afraid that it doesn't solve the problem.. the drawings of the turtle is still outside of the window borders. – GoldenRetriever Feb 03 '21 at 14:38
  • This seems like it's practically a duplicate of [this](https://stackoverflow.com/questions/29276229/how-to-implement-a-drag-feature-or-zoom-in-a-python-window-application) – Awesomepotato29 Feb 03 '21 at 14:56

0 Answers0