Q:

Why does PolyCollection always closed? 

. 
Hello, everyone. 
I tried to plot polygons through matplotlib.collections.polycollection.  However, the polygons is always closed even when I set closed=Fasle.  How can I not close my polygons?  Sample code is given below. 
import matplotlib
from matplotlib.collections import PolyCollection
import matplotlib.pyplot as plt
import numpy as np

if __name__ == '__main__':
    xy = np.random.rand(12).reshape(2,3,2)

    p=PolyCollection(xy,closed=False)
    fig = plt.figure()
    ax1 = fig.add_subplot(111)
    ax1.add_collection(p)

A:

It's actually not closing the polygon when close = False.  However, when you're "filling" the polygon, it automatically fills up to the border where it would be closed.  
Consider the following revised code
import matplotlib
from matplotlib.collections import PolyCollection
import matplotlib.pyplot as plt
import numpy as np

if __name__ == '__main__':
    xy = np.random.rand(8).reshape(1,4,2)

    p=PolyCollection(xy,closed=False, edgecolors = 'red', facecolors = 'white')
    fig = plt.figure()
    ax1 = fig.add_subplot(111)
    ax1.add_collection(p)

By setting the edgecolor to something noticeable like red, and the facecolor=white, you can clearly see that the when closed=False the polygon isn't closed.  In this case, closed means drawing the final edge between the first and last coordinates. However, if the facecolor is something like blue, it of course has to "close" the polygon to fill the space, otherwise there'd be no constraints on where the face begins and ends. 