About 18,600 results
Open links in new tab
  1. Draw Square and Rectangle in Turtle - Python - GeeksforGeeks

    Jul 12, 2025 · The task of drawing basic geometric shapes, such as squares and rectangles, can be accomplished using Python's Turtle graphics library. Turtle graphics enables us to create …

  2. How to Draw Rectangles in Matplotlib (With Examples) - Statology

    Nov 10, 2020 · To draw a rectangle in Matplotlib, you can use the matplotlib.patches.Rectangle function, which uses the following syntax: matplotlib.patches.Rectangle (xy, width, height, …

  3. Python Turtle: Draw Shapes

    Jun 26, 2025 · In this article, I’ll share everything you need to know about drawing shapes using Python’s Turtle module. The Turtle module provides a simple yet useful way to create graphics.

  4. python - How to draw a rectangle on image - Stack Overflow

    If you want to change the image data (e.g. draw a rectangle on an image), you could use PIL's ImageDraw, OpenCV, or something similar. Here is PIL's ImageDraw method to draw a …

  5. How to Properly Draw Rectangles in Matplotlib and Python

    Dec 18, 2023 · In this Matplotlib and Python tutorial, we thoroughly explain how to draw rectangles in Python and how to adjust the rectangle properties, such as transparency, face …

  6. Python Turtle - Code a Rectangle Tutorial - YouTube

    Learn how to quickly draw a rectangle using Python's Turtle module. ⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter.

  7. How to Draw a Rectangle in Python Using Turtle - Newtum

    May 14, 2023 · In this tutorial, we learned how to draw a rectangle in Python using the Turtle module. We explained each step of the code in detail, making it easy for beginners to …

  8. Matplotlib Draw Rectangle: Add, Fill, Annotate & Highlight …

    Jan 30, 2021 · Learn how to draw rectangle on plot in Matplotlib using patches. Complete Python tutorial with multiple examples

  9. How to draw rectangle in Pygame? - GeeksforGeeks

    Jun 13, 2025 · One of the most basic graphical operations in Pygame is drawing shapes, such as rectangles. Rectangles are essential for making buttons, frames, game objects and more.

  10. pygame.draw — pygame v2.6.0 documentation

    Draw several simple shapes to a surface. These functions will work for rendering to any format of surface. Most of the functions take a width argument to represent the size of stroke (thickness) …