How to add a patch in a plot in python

ipython
matplotlib

#1

I am currently trying to make patches in python .
patches-matplotlib has objects that represent many common shapes, referred as patches.
While trying to make patches such as circle , rectangular I encounter one code which I am not able to understand.

fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
rect = plt.Rectangle((0.2, 0.75), 0.4, 0.15, color='k', alpha=0.3)
circ = plt.Circle((0.7, 0.2), 0.15, color='b', alpha=0.3)
pgon = plt.Polygon([[0.15, 0.15], [0.35, 0.4], [0.2, 0.6]],
color='g', alpha=0.5)

ax.add_patch(rect)
ax.add_patch(circ)
ax.add_patch(pgon)


#2