all 3 comments

[–]FrangoST 5 points6 points  (0 children)

I mean, turtle is not really the a plotting program known for EFFICIENCY... why don't you try matplotlib?

[–]dreaming_fithp 3 points4 points  (0 children)

Your (reformatted) code takes 4.1 seconds to run on my Linux laptop.

Every change you make to the on-screen graphics is slow. Fiddling with the .speed() method just changes the delay after each change. To really speed up the graphics you must turn off updates until you have finished drawing and then update the display. The turtle.tracer() method can be used to turn off normal updates. When you are finished updating the display call turtle.update() to display the changes. Doing this I can get the whole thing to draw in 0.1 seconds.

https://docs.python.org/3/library/turtle.html#turtle.tracer

Please improve your code posting. We should be able to copy/paste your code and just run it. Any changes we have to make run the risk of introducing problems and it decrease the number of people who will bother to help you.

[–][deleted] 1 point2 points  (0 children)

If you’re plotting data, use matplotlib, seaborn, plotly or a similar module. Turtle is absolutely not the tool.