By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,002 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,002 IT Pros & Developers. It's quick & easy.

make a function for plotting

P: 9
Hi,
I have a matrixe which is include [X, Y, Z] and has 3000 rows and 3 column.
each Z is a data for it's (X, Y). for example [1, 2, 7] means; in point of (1, 2) ,value is 7.
I need to make a contour.
Help me how to do that.
Thanks a lot.
Ayat.
Jan 23 '09 #1
Share this Question
Share on Google+
2 Replies


bvdet
Expert Mod 2.5K+
P: 2,851
Are you planning to use a graphics package to display your contour? If each data point is [X,Y], how does the Z value affect the contour? People will be more willing to help if you make an effort to write the code yourself.

-BV
Jan 23 '09 #2

P: 9
This is my program which should be modified. My problem is I dont know how to define a function to make a contour with this matrixe. in fact I cant make a cooperation with (X,Y, Z ) while (X,Y) is a coordinates and Z is a value for it's (X,Y)

from matplotlib import *
from pylab import *
from load2 import *
from numpy import *

#######Read Deposition matrixe with load2 ######
Dira='/home/guest/AYAT/test/pm_modej'
A=load2(Dira)
### Defenition of Deposition matrixe ##########
dep = zeros((3000,3))
X = zeros((3000,3))
Y = zeros((3000,3))

for t in range(3000) :
dep[t, 0] = A[t, 0]
dep[t, 1] = A[t, 1]
dep[t, 2] = A[t, 2]

X[t, 0] = A[t, 0]
Y[t, 0] = A[t, 1]
############ make a contour and setting ########

CS = contourf(X, Y, dep, 9)
show()
Jan 25 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.