Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Milestone
Description
Consider this code:
import numpy as npimport matplotlib.pyplot as pltimport matplotlib.colors as colorsfrom matplotlib import cmfrom mpl_toolkits.mplot3d import Axes3Dfig = plt.figure()ax = fig.add_subplot(1, 1, 1, projection='3d')x, y = np.meshgrid(np.linspace(-1, 1), np.linspace(-1, 1))z = x**2 + y**2z[10:20, 10:20] = 0.0masked_array = np.ma.masked_equal(z, 0.0)palette = cm.graypalette.set_over('g', 1.0)palette.set_under('b', 1.0)palette.set_bad('r', 1.0)ax.plot_surface(x,y,masked_array, rstride=1, cstride=1, cmap=palette, vmin=-1, vmax=1, )plt.show()
The area set to zero should be red, but it isn't. It works on a 2d axis using pcolormesh.