Mercurial > hg > octave-nkf
comparison scripts/plot/contour.m @ 4030:22bd65326ec1
[project @ 2002-08-09 18:58:13 by jwe]
author | jwe |
---|---|
date | Fri, 09 Aug 2002 19:00:16 +0000 |
parents | c8c1ead8474f |
children | c3bb286a18a9 |
comparison
equal
deleted
inserted
replaced
4029:2cc57b6169cf | 4030:22bd65326ec1 |
---|---|
40 if (nargin == 1) | 40 if (nargin == 1) |
41 n = 10; | 41 n = 10; |
42 else | 42 else |
43 n = y; | 43 n = y; |
44 endif | 44 endif |
45 if (is_matrix (z)) | 45 if (ismatrix (z)) |
46 gset nosurface; | 46 gset nosurface; |
47 gset contour; | 47 gset contour; |
48 gset cntrparam bspline; | 48 gset cntrparam bspline; |
49 if (is_scalar (n)) | 49 if (isscalar (n)) |
50 command = sprintf ("gset cntrparam levels %d", n); | 50 command = sprintf ("gset cntrparam levels %d", n); |
51 elseif (is_vector (n)) | 51 elseif (isvector (n)) |
52 tmp = sprintf ("%f", n(1)); | 52 tmp = sprintf ("%f", n(1)); |
53 for i = 2:length (n) | 53 for i = 2:length (n) |
54 tmp = sprintf ("%s, %f", tmp, n(i)); | 54 tmp = sprintf ("%s, %f", tmp, n(i)); |
55 endfor | 55 endfor |
56 command = sprintf ("gset cntrparam levels discrete %s", tmp); | 56 command = sprintf ("gset cntrparam levels discrete %s", tmp); |
64 endif | 64 endif |
65 elseif (nargin == 3 || nargin == 4) | 65 elseif (nargin == 3 || nargin == 4) |
66 if (nargin == 3) | 66 if (nargin == 3) |
67 n = 10; | 67 n = 10; |
68 endif | 68 endif |
69 if (is_vector (x) && is_vector (y) && is_matrix (z)) | 69 if (isvector (x) && isvector (y) && ismatrix (z)) |
70 xlen = length (x); | 70 xlen = length (x); |
71 ylen = length (y); | 71 ylen = length (y); |
72 if (xlen == rows (z) && ylen == columns (z)) | 72 if (xlen == rows (z) && ylen == columns (z)) |
73 if (rows (x) == 1) | 73 if (rows (x) == 1) |
74 x = x'; | 74 x = x'; |
83 k++; | 83 k++; |
84 endfor | 84 endfor |
85 gset nosurface; | 85 gset nosurface; |
86 gset contour; | 86 gset contour; |
87 gset cntrparam bspline; | 87 gset cntrparam bspline; |
88 if (is_scalar (n)) | 88 if (isscalar (n)) |
89 command = sprintf ("gset cntrparam levels %d", n); | 89 command = sprintf ("gset cntrparam levels %d", n); |
90 elseif (is_vector (n)) | 90 elseif (isvector (n)) |
91 tmp = sprintf ("%f", n(1)); | 91 tmp = sprintf ("%f", n(1)); |
92 for i = 2:length (n) | 92 for i = 2:length (n) |
93 tmp = sprintf ("%s, %f", tmp, n(i)); | 93 tmp = sprintf ("%s, %f", tmp, n(i)); |
94 endfor | 94 endfor |
95 command = sprintf ("gset cntrparam levels discrete %s", tmp); | 95 command = sprintf ("gset cntrparam levels discrete %s", tmp); |