car*_*rla 3 python matplotlib contour
当我使用matplotlib绘制具有蒙版值的数组时countourf,蒙版值显示为白色.我希望它们显得灰色.
我尝试了这个set_bad方法,但它似乎countourf无法识别它(虽然它识别set_over和set_under方法).
我还可以使用其他方法contourf吗?
或将我不得不改变我的代码使用imshow,其理解set_bad的相反,countourf?
您是否尝试过首先设置背景,例如:
x,y=meshgrid(linspace(0,1),linspace(0,1))
fig=plt.figure()
a=fig.add_subplot(111,axisbg='gray')
z=ma.masked_array(x**2-y**2,mask=y>-x+1)
a.contourf(z)
Run Code Online (Sandbox Code Playgroud)