turtle.setworldcoordinates() function in Python Last Updated : 25 Aug, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.setworldcoordinates() This function is used to set up a user-defined coordinate system. This performs a reset. If mode 'world' is already active, all drawings are redrawn according to the new coordinates. Note: In user-defined coordinate systems angles may appear distorted. Syntax : turtle.setworldcoordinates(llx, lly, urx, ury) Parameters: llx: a number, x-coordinate of lower left corner of canvaslly: a number, y-coordinate of lower left corner of canvasurx: a number, x-coordinate of upper right corner of canvasury: a number, y-coordinate of upper right corner of canvas Below is the implementation of the above method with some examples : Example 1 : Python3 # importing package import turtle # make screen object and # set screen mode to world sc = turtle.Screen() sc.mode('world') # set world coordinates turtle.setworldcoordinates(-20, -20, 20, 20) # loop for some motion for i in range(20): turtle.forward(1+1*i) turtle.right(90) Output: Part A Example 2: Python3 # importing package import turtle # make screen object and # set screen mode to world sc = turtle.Screen() sc.mode('world') # set world coordinates turtle.setworldcoordinates(-40, -40, 40, 40) # loop for some motion for i in range(20): turtle.forward(1+1*i) turtle.right(90) Output : In the above two examples, the code are the same and only the difference of world coordinates differ the output as shown below : Example 3 : Python3 # importing package import turtle # make screen object and # set mode to world sc = turtle.Screen() sc.mode('world') # set world coordinates turtle.setworldcoordinates(-50, -50, 50, 50) # do some motion for i in range(16): turtle.forward(1+1*i) turtle.right(90) # set world coordinates turtle.setworldcoordinates(-40, -40, 40, 40) # do some motion for i in range(16): turtle.forward(1+1*(i+16)) turtle.right(90) # set world coordinates turtle.setworldcoordinates(-30, -30, 30, 30) # do some motion for i in range(16): turtle.forward(1+1*(i+32)) turtle.right(90) Output : Here, we can see that the all previous drawing is set to new world coordinates ( drawing enlarges ). Comment More infoAdvertise with us Next Article turtle.sety() function in Python D deepanshu_rustagi Follow Improve Article Tags : Python Python-turtle Practice Tags : python Similar Reads turtle.towards() function in Python The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.towards() This function is used to return the angle, between the line from t 2 min read turtle.title() function in Python The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.title() This function is used to set the title of turtle-window. It requires 1 min read turtle.resetscreen() function in Python The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.resetscreen() This function is used to reset all Turtles on the Screen to th 1 min read turtle.tracer() function in Python The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.tracer() This function is used to turn turtle animation on or off and set a 1 min read turtle.sety() function in Python The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.sety() This method is used to set the turtle's second coordinate to y, leavi 1 min read turtle.setx() function in Python The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a version of Python installed with Tk support. turtle.setx() This method is used to set the turtle's first coordinate to x, leave 1 min read Like