From: Linda_swe <po...@mt...> - 2009-05-16 13:19:31
|
This one is from Jeff here at the forum and it does work. But the smoothing of the color values inbetween the countour is not so good. How to improve that ? Also,i am still searching for a load .csv example to use with pcolor or countour. from matplotlib.mlab import load import matplotlib.pyplot as plt import numpy as np data = load("C:/Users/Pontus/data.txt") # 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() -- View this message in context: http://www.nabble.com/Colormap-using-%28UV%29coordinates-from-file-tp23572972p23573711.html Sent from the matplotlib - users mailing list archive at Nabble.com. |