擅长:python、mysql、java
<p>我猜您正在寻找一个<em>假彩色图像</em>表示。
虽然我不确定<code>matplotlib</code>是否是实现这一点的理想方式,但是<a href="https://stackoverflow.com/questions/31507479/how-to-turn-grayscale-into-false-color-using-pil#31595514">here is a post in how to do this with ^{<cd2>}</a>。它获取整个图像(包括颜色条),并将灰度图像转换为彩色RGB图像</p>
<p>你可以用<code>matplotlib</code>做同样的事情。不幸的是,这不像在<a href="https://matplotlib.org/3.2.1/api/_as_gen/matplotlib.pyplot.imshow.html" rel="nofollow noreferrer">^{<cd4>}</a>中更改颜色映射那么容易。您需要进行一些手动缩放</p>