首页 > 解决方案 > python中具有3个数组(x,y和值)的2D直方图

问题描述

我有3个数组(位置x,y和这个点的值(F)。F数组的值从负数到正数(例如-10,10)。我做了二维直方图,但是,如你所见,背景颜色为黄色。我需要颜色最低的背景。我使用的代码

h=np.histogram2d(x,y, bins=80, weights = F)
plt.figure(figsize=(5, 4), dpi=200)
plt.axes(facecolor = 'grey')
plt.imshow(h[0], extent=[-5, 5, -5, 5], origin = "lower", cmap='hot', 
interpolation="gaussian")
plt.colorbar()

我有的

我需要的

也许我做错了一切?因为我必须在中心区域有 F 数组的最大值请帮助!)

标签: pythonhistogram

解决方案


推荐阅读