在悬停时在Python中显示colormap / heatmap值

时间:2013-10-17 09:31:19

标签: python numpy matplotlib hover heatmap

我是Python新手并且发现我可以通过以下方式绘制彩色地图:

    import matplotlib.pyplot as plt
    #some image generating code

    plot = plt.imshow(image)
    plot.set_cmap(cmap)
    plot.set_interpolation(interpolation_method)
    plt.show()

在我的情况下,图像是一个二维的numpy数组。 结果我得到了一个漂亮的色彩图(由于我是这个平台的新手,因此无法发布它的图像)。 链接到我的颜色图:http://s7.directupload.net/images/131017/t9aczkmq.png

enter image description here

  

我的问题

     
    

有没有办法在鼠标悬停时显示上部色彩映射中位置/像素的当前值?我需要显示实际值(在已绘制的数组中)而不是颜色值。

  
     

附加问题

     
    

是否还有一种方法可以将切片器添加到输出中,以便动态更改颜色贴图的切割(类似于FITS查看器)。

  

可能我只需要合适的模块,但我找不到任何适合我的需求。 提前谢谢!

0 个答案:

没有答案
相关问题