擅长:python、mysql、java
<p><code>imshow</code>图是用一个值初始化的(在本例中是1),因此任何规格化为1到1之间的值都将变成相同的颜色。在</p>
<p>为了改变这种情况,你可以</p>
<ol>
<li>启动带有颜色限制的<code>imshow</code>绘图(<code>vmin=0, vmax=1</code>)。在</li>
<li><p>用一个规范化实例初始化<code>imshow</code>图</p>
<pre><code>norm = matplotlib.colors.Normalize(vmin=0, vmax=1)
im = plt.imshow(arr, norm=norm)
</code></pre></li>
<li>之后使用<code>im.set_clim(0,1)</code>设置限制。在</li>
</ol>