About 5,840,000 results
Open links in new tab
  1. Create different shapes using Canvas class in Tkinter – Python

    Apr 12, 2025 · Canvas.create_polygon (coordinates, options = …): Used to create any valid shape defined by a series of points. The coordinates are passed as a list of (x, y) pairs. This Python code uses Tkinter to create a simple GUI that displays various shapes on a canvas.

  2. tkinter - How to draw polygons with Python? - Stack Overflow

    May 15, 2017 · If you want to draw polygons on a matrix representing an image, scikit-image has 3 functions for you: skimage.draw.polygon2mask(image_shape, polygon) that directly returns a bool-type numpy.array where True means the point is inside the polygon.

    Missing:

    • Program

    Must include:

  3. python - How to create a shapely Polygon from a list of shapely …

    If you specifically want to construct your Polygon from the shapely geometry Points, then call their x, y properties in a list comprehension. In other words: from shapely import geometry poly = geometry.Polygon([[p.x, p.y] for p in pointList]) print(poly.wkt) …

    Missing:

    • Program

    Must include:

  4. How to Draw Shapes in Matplotlib with Python - GeeksforGeeks

    Jul 22, 2024 · Drawing shapes in Matplotlib is simple and provides a wide range of options for creating and customizing displays. Using the Rectangle, Circle, and Polygon classes, you can add different shapes to your plots to help with data representation or visualization style.

  5. Draw any polygon in Turtle – Python - GeeksforGeeks

    Feb 10, 2020 · In this article, we will learn how to draw different shaped Polygons using Turtle module. Given the number of sides (n) and length of sides (l), one can easily draw any polygon shape. Let’s try to understand it better with the help of examples.

  6. How to create and plot polygons in python using shapely and

    Nov 15, 2023 · In this article, we will explore how to plot polygons in python using shapely library. Shapely is a python package for computational geometry which provides easy access to geometric objects such as points, lines, and polygons.

    Missing:

    • Program

    Must include:

  7. How to Draw Different Shapes Using Tkinter - AskPython

    Jan 29, 2022 · 4. Polygon. We can draw as many vertices as we want. We use the create_polygon() method which takes coordinates of edges and renders them accordingly on our main window. In the below code we’ve created a list of coordinates and passed it into our create_polygon method.

  8. Shapes in Python - Plotly

    As a general rule, there are two ways to add shapes (lines or polygons) to figures: Trace types in the scatter family (e.g. scatter, scatter3d, scattergeo etc) can be drawn with mode="lines" and optionally support a fill="self" attribute, and so can be used to …

    Missing:

    • Program

    Must include:

  9. python - How to draw a polygon on a tkinter canvas using a class ...

    Nov 17, 2015 · def create_polygon(self, points, colour, posit): try: shape.delete(self.poly) except: pass. self.poly = shape.create_polygon(points, colour, posit) self.poly.shape.grid(column=posit[0],row=posit[1]) I'm new to using tkinter and classes but I want to make a very simple class to create a regular polygon.

  10. EzGraphics: Python Graphics Made Easy | UserGuide / Polygons

    Simple polygons can be drawn on a canvas using using the drawPolygon() canvas method. A simple polygon is a closed shape with three or more vertices in which adjacent vertices are connected by straight line segments.

  11. Some results have been removed
Refresh