我尝试了tephigramDocs第11页的示例,但是它引发了ValueError
。代码如下:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os.path
import tephi
dew_point = os.path.join(tephi.DATA_DIR, ’dews.txt’)
dew_data = tephi.loadtxt(dew_point, column_titles=(’pressure’, ’dewpoint’))
dews = zip(dew_data.pressure, dew_data.dewpoint)
tpg = tephi.Tephigram()
tpg.plot(dews)
plt.show()
显然,传递给plot函数的数据格式是错误的,但是我找不到解决方案。错误消息是:
ValueError: The environment profile data requires to be a sequence of pressure, temperature value pairs.