I'm trying to plot data from a text file (data format: "lat lon value") using matplotlib and I keep getting an error that I can't figure out how to get around.
Data Example:
42.88355 -76.78116 81
37.1417 -79.0164 81
36.65408 -83.21783 73
41.00928 -74.73628 69
42.29133 -73.71033 72
43.77714 -71.75598 83
44.41944 -72.01944 85
41.98525 -73.96409 82
temp.py Script Code:
from matplotlib.mlab import load
import matplotlib.pyplot as plt
import numpy as np
data = load("/home/weather/data/.../site_data")
# need to know nlons and nlats beforehand!
nlons = 8; nlats = 25
X = data[0::nlats,0]
Y = data[0:nlats,1]
# data is in nlons,nlats order in file, need to transpose
Z = data[:,2].reshape(nlons,nlats).transpose()
X,Y = np.meshgrid(X,Y)
CS = plt.contourf(X,Y,Z,20)
plt.show()
Error:
Traceback (most recent call last):
File "temp.py", line 1, in <module>
from matplotlib.mlab import load
ImportError: cannot import name load