M = 10
x = np.random.random((M, N))
mask = np.random.random_integers(0, 1, N * M).reshape((M, N))
x = np.ma.array(x, mask=mask)
ax1 = fig.add_subplot(2, 1, 1)
ax1.boxplot(x)
z = [[y for y in row if y] for row in x.T]
ax2 = fig.add_subplot(2, 1, 2)
ax2.boxplot(z)
plt.show()
Boxplotting Masked Arrays