如何在 "pure" python 中制作这个 plot.ly 热图式的图?

How to make this plot.ly heatmap-esque plot in "pure" python?

是否有一个等效的绘图函数 and/or 一个简单的方法可以在 python 中 "pure" python 中绘制此 plot.ly 图,例如使用matplotlib?

from here.

只是想知道是否有等效或类似的功能。找不到任何东西,或者我没有在寻找合适的东西。 "heatmap python" 只能得出方块图,改形状好像很麻烦

给大家举个简单的例子,下面会生成附图

from pylab import *
Z = rand(6, 100) # tried to make it look similar to your plot
c = pcolor(Z)
show()

基于Hun answer,如果你不想让你的眼睛太痛,你可以使用替代色图。这里viridis

import matplotlib.pyplot as plt
import numpy as np
Z = np.random.rand(6, 100)
c = plt.pcolor(Z, cmap='viridis')
plt.show()

记住:pyplot & numpy 会让你的命名空间保持整洁...