将python matplotlib colormap动态范围更改为特定范围

将python matplotlib colormap动态范围更改为特定范围,python,dynamic,matplotlib,range,colormap,Python,Dynamic,Matplotlib,Range,Colormap,我已经创建了一个二维高斯函数用于显示,变量高斯(如下)在(0,1)范围内。我要做的是将默认的colormap动态范围从(黑色,白色)更改为(灰色,白色) 您可以将颜色贴图Greys_r与参数vmin=0.25和vmax=1一起使用。 from matplotlib import cm p = plt.imshow(gauss, cmap=cm.Greys_r, vmin=025, vmax=1.) 3Q,但我想缩小范围,而不是将其反转。^ ^,已检查。我是新手。 from matplotli

我已经创建了一个二维高斯函数用于显示,变量高斯(如下)在(0,1)范围内。我要做的是将默认的colormap动态范围从(黑色,白色)更改为(灰色,白色)


您可以将颜色贴图
Greys_r
与参数
vmin=0.25
vmax=1一起使用。

from matplotlib import cm

p = plt.imshow(gauss, cmap=cm.Greys_r, vmin=025, vmax=1.)

3Q,但我想缩小范围,而不是将其反转。^ ^,已检查。我是新手。
from matplotlib import cm

p = plt.imshow(gauss, cmap=cm.Greys_r, vmin=025, vmax=1.)