make a function for plotting

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amirayat
    New Member
    • Jan 2009
    • 9

    make a function for plotting

    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.
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    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

    Comment

    • amirayat
      New Member
      • Jan 2009
      • 9

      #3
      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()

      Comment

      Working...