我有2个文本文件,每两列包含数字,如下所示:
26 0.000342231
27 0.000342231
28 0.000684463
29 0.00136893
30 0.00102669
31 0.00308008
32 0.00308008
33 0.00444901
...
77 0.00102669
79 0.000684463
80 0.000342231
81 0.000342231
82 0.000684463
和以下用于绘图的python代码:
import numpy as np
import matplotlib.pyplot as plt
import scipy, scipy.stats
plt.plotfile('histdata1.txt', delimiter=' ', cols=(0, 1), names=('stale block', 'frequency'), marker='o', markersize=5, c='r', alpha=0.5, linewidth=0, markeredgewidth=0, markeredgecolor='w')
plt.plotfile('histdata3.txt', delimiter=' ', cols=(0, 1), names=('stale block', 'frequency'), marker='o', markersize=5, c='g', alpha=0.5, linewidth=0, markeredgewidth=0, markeredgecolor='w')
plt.show()
这段代码在不同的图形上生成两个图-但是我希望两个图形都在同一图形上。我怎样才能做到这一点?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句