home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / maths / plplot / plplot_2 / examples / f77 / x11f.f < prev    next >
Encoding:
Text File  |  1994-05-26  |  1.7 KB  |  60 lines

  1. ! $Id: x11f.f,v 1.2 1994/05/26 19:34:25 mjl Exp $
  2. ! $Log: x11f.f,v $
  3. ! Revision 1.2  1994/05/26  19:34:25  mjl
  4. ! Inserted missing CVS Id and Log fields for all Fortran demos.  Comment
  5. ! character changed to "!" everywhere, to work well with font-lock in Lucid
  6. ! emacs (requires a small change to fortran-mode.el).
  7. !
  8. !
  9. !     Demonstration of mesh plotting 
  10.  
  11.       parameter (NPTS=41)
  12.       integer opt(4)
  13.       real alt(4), az(4)
  14.       real x(NPTS), y(NPTS), z(NPTS,NPTS)
  15.       character*80 title(4)
  16.  
  17.       data opt /1,   2,   3,   3/
  18.       data alt /60.0,20.0,60.0,60.0/
  19.       data az /30.0,60.0,120.0,160.0/
  20.  
  21.       data title /"#frPLPLOT Example 11 - Alt=60, Az=30, Opt=1",
  22.      *            "#frPLPLOT Example 11 - Alt=20, Az=60, Opt=2",
  23.      *            "#frPLPLOT Example 11 - Alt=60, Az=120, Opt=3",
  24.      *            "#frPLPLOT Example 11 - Alt=60, Az=160, Opt=3"/
  25.  
  26.       do 1 i=1,NPTS
  27.          x(i) = (i-1-(NPTS/2))/float(NPTS/2)
  28.          y(i) = (i-1-(NPTS/2))/float(NPTS/2)
  29. 1     continue
  30.  
  31.       do 2 i=1,NPTS
  32.          xx = x(i)
  33.          do 3 j=1,NPTS
  34.             yy = y(j)
  35.             r = sqrt(xx*xx + yy*yy)
  36.             z(i,j) = exp(-r*r) * cos(2.0*3.141592654*r)
  37. 3        continue
  38. 2     continue
  39.  
  40.       call plinit()
  41.  
  42.       do 4 k=1,4
  43.          call pladv(0)
  44.          call plcol(1)
  45.          call plvpor(0.0,1.0,0.0,0.9)
  46.          call plwind(-1.0,1.0,-0.9,1.1)
  47.  
  48.          call plw3d(1.0,1.0,1.0,-1.0,1.0,-1.0,1.0,-1.0,1.0,alt(k),az(k))
  49.          call plbox3("bnstu","x axis",0.0,0,"bnstu","y axis",0.0,0,
  50.      *               "bcdmnstuv","z axis",0.0,0)
  51.          call plcol(2)
  52.          call plmesh(x,y,z,NPTS,NPTS,opt(k),NPTS)
  53.          call plcol(3)
  54.          call plmtex("t",1.0,0.5,0.5,title(k))
  55. 4     continue
  56.  
  57.       call plend
  58.  
  59.       end
  60.