From: Linda_swe <po...@mt...> - 2009-05-17 14:21:36
|
Why dont anyone answer me??? atlest give me a hint... Ok, so i want to use the my csv as input and then plot the contour. I have the follwing code but gives error:list object has no attribute reshape is using list diffrent than using numpys loadtext and then into variables ??? from matplotlib.mlab import load import matplotlib.pyplot as plt import numpy as np import csv portfolio = csv.reader(open("file.csv", "rb")) portfolio_list = [] portfolio_list.extend(portfolio) lats = [] lons = [] values=[] for data in portfolio_list: lats.append(data[0]) lons.append(data[1]) values.append(data[2]) print lats print lons nlats = len(lats) nlons = len(lons) yre = lats.reshape(nlats,nlons) xre = lons.reshape(nlats,nlons) zre = values.reshape(nlats,nlons) #### later in the defined map CT = plt.contourf(xre, yre, zre, cmap=color_map) cbar = plt.colorbar() plt.show() -- View this message in context: http://www.nabble.com/Colormap-using-%28UV%29coordinates-from-file-tp23572972p23583803.html Sent from the matplotlib - users mailing list archive at Nabble.com. |