【问题标题】:Matplotlib plot just the top line in a histogramMatplotlib 仅绘制直方图中的第一行
【发布时间】:2020-07-15 06:42:07
【问题描述】:

我有一个matplotlib 图,它在同一个图中绘制了多个(大约 4-5 个)不同的直方图。但是,为了防止它变得过于拥挤,我想绘制相同的直方图,但只有顶部水平线(所以它看起来像 plt.plot() 连续线,但由很多步骤组成)。我该怎么做?

谢谢。

【问题讨论】:

  • 给我们示例数据和绘图。

标签: python matplotlib histogram


【解决方案1】:

使用关键字参数plt.hist(data,histtype='step')https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.hist.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-09
    • 2015-10-25
    • 2012-01-12
    • 2020-12-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多