menu_book Course Curriculum (Matplotlib) expand_more
Figure Basics
Axes & Labels
Styling
Layouts
Statistical Plots
Images & Geometry
Scales & Dates
Output & Interaction
Polygon patch
Learn Polygon patch in Matplotlib with a dedicated explanation, a topic-specific example, edge guidance, and a mastery check.
12 min read
•
Intermediate
Advertisement
matplotlib-046.py
python
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.patches import Polygon
fig,ax=plt.subplots(); ax.add_patch(Polygon([[0,0],[2,0],[1,2]],closed=True,alpha=.4)); ax.set(xlim=(-1,3),ylim=(-1,3)); plt.show()
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content