我试图使用python matplotlib从文本文件绘制两列,但我得到转换错误
ValueError: invalid literal for float(): 148.000000;
这是我的Python脚本
import numpy as np
import matplotlib.pyplot as plt
x,y = np.loadtxt('sharma5.txt')
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(x,y)
plt.show()
这里我的文本的一部分文件
36.000000 61.000000
36.000000 61.000000
36.000000 148.000000;
36.000000 60.000000
36.000000 120.000000
36.000000 77.000000
36.000000 160.000000
在此先感谢..
请记住使用Ctrl-K格式化您的代码! – ptomato 2012-04-03 08:21:12