我有一个matplotlib图,在同一个图中绘制了多个(大约4-5个)不同的直方图。然而,为了防止它变得过于拥挤,我想绘制相同的直方图,但只有顶部水平线(所以它看起来像一条plt.plot()连续的线,但由许多步骤组成)。我怎么做?
matplotlib
plt.plot()
hpcdzsge1#
使用关键字参数plt.hist(data,histtype='step') . https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.hist.html
plt.hist(data,histtype='step')
1条答案
按热度按时间hpcdzsge1#
使用关键字参数
plt.hist(data,histtype='step')
. https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.hist.html