home *** CD-ROM | disk | FTP | other *** search
- : Prof2d, The 2D Scientific Spreadsheet
- : by Gertjan L. Ouwerling, Electrical Materials Lab, Delft University
- : -------------------------------------------------------------------
- : Example 2: Making contour plots from internally generated data.
- :
- : If you have a HP7550A or HP7475 plotter connected to your PC,
- : you can try the contour plots by changing cview commands in cview.
- :
- : Execute this example by typing: prof2d example2.pr2 <enter>
- :
- : NOTE: some steps may be slow without a co-processor!
- :
- : -------------------------------------------------------------------
- : In this example, synthetic data is generated internally
- : and two contour plots of this data are drawn.
- : These plots are depicted following this example.
- : The data is also output to file in several formats.
- :
- : Declaration of program data types:
- :
- row x1 x2 $
- column y1 y2 $
- field z1 z2 $
- :
- : Data space is allocated and x- and y-axes are made;
- : x and y both run between 0 and 2*pi.
- :
- nx=20
- ny=30
- x1=xcount/(nx-1)*2*pi
- y1=ycount/(ny-1)*2*pi
- :
- : The value of the field z1 is computed using x and y
- :
- z1=sin(x1)+cos(y1)
- :
- : A contour plot of z1 is made in one color, without markers,
- : and on A4 size paper. The contour values are chosen by setcont.
- : xscl and yscl are not altered, hence autoscaling with identical
- : scales for x and y will be used.
- :
- : ENABLE PLOTTING BY CHANGING COMMAND cview IN cplot !
- :
- asize=4
- color=0
- marker=0
- setcont -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 $
- cview x1 y1 z1 sin(x)+cos(y) | Demonstration plot
- :
- : A 2nd contour plot is made with distorted axes.
- : The other condition are equal, except that now markers
- : are drawn.
- :
- marker=1
- x2=sqrt(x1)/sqrt(2*pi)
- y2=sqrt(y1)/sqrt(2*pi)
- cview x2 y2 z1 sin(x1)+cos(y1) <-> x2,y2 | x2=sqrt(x1)/sqrt(2*pi) | Demo plot 2
- :
- : Some data is saved in listed form.
- : Before doing so, the fields are thinned to save disk space.
- :
- redx 2
- redy 2
- put list.dat x1 x2 y1 y2 z1 $
- :
- : And some data is saved in matrix form.
- :
- mput mat.dat x1 y2 z1
- :
- : End of this prof2d program
- :
- : -----------------------------------
- :
- : Give quit <enter> to leave Prof2d
- : or continue playing around a little
- :
-
-