Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python draw polygon

# credit to the Stack Overflow user in the source link

import matplotlib.pyplot as plt

coord = [[1,1], [2,1], [2,2], [1,2], [0.5,1.5]]
coord.append(coord[0]) # repeat the first point to create a 'closed loop'

xs, ys = zip(*coord) # create lists of x and y values

plt.figure()
plt.plot(xs,ys) 
plt.show() 
Comment

PREVIOUS NEXT
Code Example
Python :: loop through 2 dataframes at once 
Python :: python color text console 
Python :: python selenium assert presence of an element 
Python :: Resource punkt not found. Please use the NLTK Downloader to obtain the resource: 
Python :: python delete header row 
Python :: mouse module python 
Python :: python sort 2d list 
Python :: read_csv Unnamed: 0 
Python :: how to make python speak 
Python :: on member leave event in discord.py 
Python :: parcourir une liste par la fin python 
Python :: convert categorical column to int in pandas 
Python :: while loop countdown python 
Python :: how to multiply two tuples in python 
Python :: python convert hex to binary 
Python :: forbidden (csrf cookie not set.) django rest framework 
Python :: python timedelta 
Python :: time delta python 
Python :: python datetime to utc 
Python :: pandas get column values distinct 
Python :: python file name from absolute path 
Python :: how to check if everything inside a list is unique 
Python :: how to display a manytomany field in django rest framework 
Python :: trimming spaces in string python 
Python :: from matrix to array python 
Python :: round godot 
Python :: indices of true boolean array pyton 
Python :: python moving average time series 
Python :: print complete dataframe pandas 
Python :: python remove duplicates from 2d list 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =