我正在尝试使用python中的pcolor绘制DFT(离散傅立叶变换)图。我以前一直在使用Mathematica 8.0来实现这一点,但我发现mathematica8.0中的colorbar与我试图表示的数据有着糟糕的一一对应关系。例如,下面是我正在绘制的数据:[[0.,0.,0.10664,0.,0.,0.,0.0412719,0.,0.,0.],
[0.,0.351894,0.,0.17873,0.,0.,0.,0.,0.,0.],
[0.10663,0.,0.178183,0.,0.,0.,0.0405148,0.,0.,0.],
[0.,0.177586,0.,0.,0.,0.0500377,0.,0.,0.,0.],
[0.,0.,0.,0.,0.0588906,0.,0.,0.,0.,0.],
[0.,0.,0.,0.0493811,0.,0.,0.,0.,0.,0.],
[0.0397341,0.,0.0399249,0.,0.,0.,0.,0.,0.,0.],
[0.,0.,0.,0.,0.,0.,0.,0.,0.,0.],
[0.,0.,0.,0.,0.,0.,0.,0.,0.,0.],
[0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]]
所以,它在DFT矩阵中有很多零或小数目,或者有少量的高频能量。
当我使用mathematica绘制此图时,结果如下:
颜色栏关闭了,我想我想用python来代替。
我的python代码(我从here中劫持的代码)是:from numpy import corrcoef, sum, log, arange
from numpy.random import rand