python - python,直方图,数据拟合
问题描述
我希望在 Python 3 中从包含能量原始数据 (.dat) 的输入文件制作直方图。在同一个图上,我想绘制一个公式(分布分析,pho 与能量)。单独绘制它们很容易,但我需要组合版本。你能帮我吗?
解决方案
如果你想在同一个图中有 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 -双尺度-py
ax2 = ax1.twinx() # instantiate a second axes that shares the same x-axis
推荐阅读
- asp.net - 使用 ASP.NET 进行引导切换
- java - 用于匹配 mp3 URL 的正则表达式
- docker - 强制步骤缓存在 Dockerfile 中
- sql - 创建包含零小时周的用户时间报告
- python - 如何修复输出文件不逐行破坏输出?
- r - 在 df1 中创建一个新的分类变量,该变量考虑一个 df1 变量和多个具有多个条件的 df2 变量
- javascript - 如何解释结果(了解 js 中的 let 和 var)
- vue.js - Vue.js 仅在 index.html 上呈现组件
- crystal-lang - 带有宏的水晶类未编译
- iis - 我无法在 Windows 8.1 上启用 ASP Classic