axs[1].set_title('Mask of everything within one contour line')
axs[1].imshow(mask, cmap=plt.cm.Greys_r, interpolation='none')
print(np.ma.MaskedArray(Z, mask=~mask).sum())
How to go from a contour to an image mask in with Matplotlib