【问题标题】:python, histogram,data fittingpython,直方图,数据拟合
【发布时间】:2020-04-29 18:12:57
【问题描述】:

我希望在 Python 3 中从包含能量原始数据 (.dat) 的输入文件制作直方图。在同一个图上,我想绘制一个公式(分布分析,pho 与能量)。单独绘制它们很容易,但我需要组合版本。你能帮忙吗?

【问题讨论】:

  • 你试过matplotlib.pyplot.subplot 吗?

标签: python histogram


【解决方案1】:

如果您想在同一个图中有 2 个图,请查看以下内容: https://matplotlib.org/3.1.0/gallery/subplots_axes_and_figures/subplots_demo.html

fig, (ax1, ax2) = plt.subplots(2)

如果您想在共享轴的同一图中有 2 个图,请使用: https://matplotlib.org/3.1.0/gallery/subplots_axes_and_figures/two_scales.html#sphx-glr-gallery-subplots-axes-and-figures-two-scales-py

ax2 = ax1.twinx() # instantiate a second axes that shares the same x-axis

【讨论】:

    猜你喜欢
    • 2016-02-22
    • 2020-10-17
    • 1970-01-01
    • 2014-11-07
    • 1970-01-01
    • 1970-01-01
    • 2014-07-08
    相关资源
    最近更新 更多