Mercurial > octave-nkf
comparison scripts/plot/mesh.m @ 5215:32c569794216
[project @ 2005-03-16 18:54:42 by jwe]
author | jwe |
---|---|
date | Wed, 16 Mar 2005 18:54:52 +0000 |
parents | eecc24b92d97 |
children | 3d9afb170a39 |
comparison
equal
deleted
inserted
replaced
5214:eecc24b92d97 | 5215:32c569794216 |
---|---|
39 ## no way to determine their current values. | 39 ## no way to determine their current values. |
40 | 40 |
41 if (nargin == 1) | 41 if (nargin == 1) |
42 z = x; | 42 z = x; |
43 if (ismatrix (z)) | 43 if (ismatrix (z)) |
44 __gset__ hidden3d; | 44 __gnuplot_set__ hidden3d; |
45 __gset__ data style lines; | 45 __gnuplot_set__ data style lines; |
46 __gset__ surface; | 46 __gnuplot_set__ surface; |
47 __gset__ nocontour; | 47 __gnuplot_set__ nocontour; |
48 __gset__ noparametric; | 48 __gnuplot_set__ noparametric; |
49 __gset__ nologscale; | 49 __gnuplot_set__ nologscale; |
50 __gset__ view 60, 30, 1, 1 | 50 __gnuplot_set__ view 60, 30, 1, 1 |
51 __gsplot__ (z'); | 51 __gnuplot_splot__ (z'); |
52 else | 52 else |
53 error ("mesh: argument must be a matrix"); | 53 error ("mesh: argument must be a matrix"); |
54 endif | 54 endif |
55 elseif (nargin == 3) | 55 elseif (nargin == 3) |
56 if (isvector (x) && isvector (y) && ismatrix (z)) | 56 if (isvector (x) && isvector (y) && ismatrix (z)) |
67 zz(:,i) = x(k) * ones (ylen, 1); | 67 zz(:,i) = x(k) * ones (ylen, 1); |
68 zz(:,i+1) = y; | 68 zz(:,i+1) = y; |
69 zz(:,i+2) = z(:,k); | 69 zz(:,i+2) = z(:,k); |
70 k++; | 70 k++; |
71 endfor | 71 endfor |
72 __gset__ hidden3d; | 72 __gnuplot_set__ hidden3d; |
73 __gset__ data style lines; | 73 __gnuplot_set__ data style lines; |
74 __gset__ surface; | 74 __gnuplot_set__ surface; |
75 __gset__ nocontour; | 75 __gnuplot_set__ nocontour; |
76 __gset__ nologscale; | 76 __gnuplot_set__ nologscale; |
77 __gset__ parametric; | 77 __gnuplot_set__ parametric; |
78 __gset__ view 60, 30, 1, 1 | 78 __gnuplot_set__ view 60, 30, 1, 1 |
79 __gsplot__ (zz); | 79 __gnuplot_splot__ (zz); |
80 __gset__ noparametric; | 80 __gnuplot_set__ noparametric; |
81 else | 81 else |
82 msg = "mesh: rows (z) must be the same as length (y) and"; | 82 msg = "mesh: rows (z) must be the same as length (y) and"; |
83 msg = sprintf ("%s\ncolumns (z) must be the same as length (x)", msg); | 83 msg = sprintf ("%s\ncolumns (z) must be the same as length (x)", msg); |
84 error (msg); | 84 error (msg); |
85 endif | 85 endif |
95 zz(:,i) = x(:,k); | 95 zz(:,i) = x(:,k); |
96 zz(:,i+1) = y(:,k); | 96 zz(:,i+1) = y(:,k); |
97 zz(:,i+2) = z(:,k); | 97 zz(:,i+2) = z(:,k); |
98 k++; | 98 k++; |
99 endfor | 99 endfor |
100 __gset__ hidden3d; | 100 __gnuplot_set__ hidden3d; |
101 __gset__ data style lines; | 101 __gnuplot_set__ data style lines; |
102 __gset__ surface; | 102 __gnuplot_set__ surface; |
103 __gset__ nocontour; | 103 __gnuplot_set__ nocontour; |
104 __gset__ nologscale; | 104 __gnuplot_set__ nologscale; |
105 __gset__ parametric; | 105 __gnuplot_set__ parametric; |
106 __gset__ view 60, 30, 1, 1 | 106 __gnuplot_set__ view 60, 30, 1, 1 |
107 __gsplot__ (zz); | 107 __gnuplot_splot__ (zz); |
108 __gset__ noparametric; | 108 __gnuplot_set__ noparametric; |
109 else | 109 else |
110 error ("mesh: x, y, and z must have same dimensions"); | 110 error ("mesh: x, y, and z must have same dimensions"); |
111 endif | 111 endif |
112 else | 112 else |
113 error ("mesh: x and y must be vectors and z must be a matrix"); | 113 error ("mesh: x and y must be vectors and z must be a matrix"); |