comparison scripts/plot/contour.m @ 2520:a034dcdbc282

[project @ 1996-11-15 04:57:21 by jwe]
author jwe
date Fri, 15 Nov 1996 04:59:08 +0000
parents b5568c31ee2c
children 1d2a83e8a9a3
comparison
equal deleted inserted replaced
2519:6914eab16f0b 2520:a034dcdbc282
31 n = 10; 31 n = 10;
32 endif 32 endif
33 33
34 if (nargin == 1 || nargin == 2) 34 if (nargin == 1 || nargin == 2)
35 if (is_matrix (z)) 35 if (is_matrix (z))
36 set nosurface; 36 gset nosurface;
37 set contour; 37 gset contour;
38 set cntrparam bspline; 38 gset cntrparam bspline;
39 command = sprintf ("set cntrparam levels %d", n); 39 command = sprintf ("gset cntrparam levels %d", n);
40 eval (command); 40 eval (command);
41 set noparametric; 41 gset noparametric;
42 set view 0, 0, 1.9, 1; 42 gset view 0, 0, 1.9, 1;
43 gsplot z w l 1; 43 gsplot z w l 1;
44 else 44 else
45 error ("mesh: argument must be a matrix"); 45 error ("mesh: argument must be a matrix");
46 endif 46 endif
47 elseif (nargin == 4) 47 elseif (nargin == 4)
59 zz(:,i) = x; 59 zz(:,i) = x;
60 zz(:,i+1) = y(k) * ones (xlen, 1); 60 zz(:,i+1) = y(k) * ones (xlen, 1);
61 zz(:,i+2) = z(:,k); 61 zz(:,i+2) = z(:,k);
62 k++; 62 k++;
63 endfor 63 endfor
64 set nosurface; 64 gset nosurface;
65 set contour; 65 gset contour;
66 set cntrparam bspline; 66 gset cntrparam bspline;
67 command = sprintf ("set cntrparam levels %d", n); 67 command = sprintf ("set cntrparam levels %d", n);
68 eval (command); 68 eval (command);
69 set parametric; 69 gset parametric;
70 set view 0, 0, 1.9, 1; 70 gset view 0, 0, 1.9, 1;
71 gsplot zz w l 1; 71 gsplot zz w l 1;
72 else 72 else
73 msg = "mesh: rows (z) must be the same as length (x) and"; 73 msg = "mesh: rows (z) must be the same as length (x) and";
74 msg = sprintf ("%s\ncolumns (z) must be the same as length (y)", msg); 74 msg = sprintf ("%s\ncolumns (z) must be the same as length (y)", msg);
75 error (msg); 75 error (msg);