2D histogram with Python

守給你的承諾、 提交于 2019-12-06 01:13:45

I guess that you could simply do

H_log = np.log(H)
…
plt.imshow(H_log,…)

(assuming that you don't have null counts).

If you want a 3D bar chart instead, you can adapt the example provided in the Matplotlib documentation.

More generally, I heartily recommend that you check the very useful Matplotlib gallery, when you are looking for some specific graphing capabilities.

Saullo G. P. Castro

In this answer there is a solution for 2D and 3D Scatter and Bubble Histograms.

points, sub = hist2d_scatter( radius, density, bins=4 )

points, sub = hist3d_scatter( temperature, density, radius, bins=4 )

Where sub is a matplotlib "Subplot" instance (3D or not) and pointscontains the points used for the scatter plot.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!