Hi all,
I have been using matplotlib for about 5 hours :-/ so please forgive me if
the question has been asked several times (and i have been trying to find it
in the forum)
But i downloaded phyton(xy) and from there i found the poormans_countour and
some pcolor scripts. I think this is what i need but how do i load a
textfile (.csv or -txt with columns etc) that contains UV-coordinates
(ordinary xy) with a assigned value and put them into the Z variables in the
.py scripts ?? i.e
from numpy import *
from pylab import load
from pylab import save
read_data = load("myfile.txt")
// here how to assign Z to read_data
cmap = cm.get_cmap('jet', 35) # 35 discrete colors
im = imshow(Z, cmap=cmap, interpolation='bilinear')
axis('off')
colorbar()
show()
The same goes for the pcolor plot, how can i replace the func3 so it contais
an array of my values from the loaded file ?
def func3(x,y):
return (1- x/2 + x**5 + y**3)*exp(-x**2-y**2)
# make these smaller to increase the resolution
dx, dy = 0.05, 0.05
x = arange(-3.0, 3.0, dx)
y = arange(-3.0, 3.0, dy)
X,Y = meshgrid(x, y)
Z = func3(X, Y)
ax = subplot(111)
im = imshow(Z, cmap=cm.jet)
#im.set_interpolation('nearest')
#im.set_interpolation('bicubic')
im.set_interpolation('bilinear')
Thanks in advance :handshake:
/Linda
--
View this message in context:
http://www.nabble.com/Colormap-using-%28UV%29coordinates-from-file-tp23572972p23572972.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users