如何更改3d matplotlib plot_surface中离散色彩级别的数量?
e.g
normalisation = matplotlib.colors.Normalize(vmin=numpy.amin(Z), vmax=numpy.amax(Z))
axis.plot_surface(X,Y,Z,cmap=matplotlib.pyplot.cm.Greys,norm=normalisation)
但是N级色彩超过标准化范围?
答案 0 :(得分:0)
请尝试将其用于规范化,其中n是级别数:
cmap = matplotlib.pyplot.cm.Greys
bounds = numpy.linspace(numpy.amin(Z),numpy.amax(Z), n + 1)
normalisation = matplotlib.colors.BoundaryNorm(bounds, cmap.N)