# You can control the color of the masked region. We copy the default colormap # before modifying it. cmap = copy.copy(cm.get_cmap(plt.rcParams['image.cmap'])) cmap.set_bad('y', 1.0) axs[1].pcolormesh(Qx, Qz, Zm, shading='gouraud', cmap=cmap) axs[1].set_title('With masked values')
# Or use the default, which is transparent. axs[2].pcolormesh(Qx, Qz, Zm, shading='gouraud') axs[2].set_title('With masked values')