comparison scripts/plot/fill.m @ 14230:fe65588c31b8

fill.m: Return column vector of graphics handles * fill.m: Return column vector of graphics handles
author Rik <octave@nomad.inbox5.com>
date Wed, 18 Jan 2012 21:17:14 -0800
parents 72c96de7a403
children 11949c9795a0
comparison
equal deleted inserted replaced
14229:741340c02522 14230:fe65588c31b8
44 for i = 1 : length (iargs) 44 for i = 1 : length (iargs)
45 if (i > 1 && strncmp (nextplot, "replace", 7)) 45 if (i > 1 && strncmp (nextplot, "replace", 7))
46 set (h, "nextplot", "add"); 46 set (h, "nextplot", "add");
47 endif 47 endif
48 if (i == length (iargs)) 48 if (i == length (iargs))
49 args = varargin (iargs(i):end); 49 args = varargin(iargs(i):end);
50 else 50 else
51 args = varargin (iargs(i):iargs(i+1)-1); 51 args = varargin(iargs(i):iargs(i+1)-1);
52 endif 52 endif
53 newplot (); 53 newplot ();
54 [tmp, fail] = __patch__ (h, args{:}); 54 [tmp, fail] = __patch__ (h, args{:});
55 if (fail) 55 if (fail)
56 print_usage(); 56 print_usage ();
57 endif 57 endif
58 htmp (end + 1) = tmp; 58 htmp(end + 1, 1) = tmp;
59 endfor 59 endfor
60 if (strncmp (nextplot, "replace", 7)) 60 if (strncmp (nextplot, "replace", 7))
61 set (h, "nextplot", nextplot); 61 set (h, "nextplot", nextplot);
62 endif 62 endif
63 unwind_protect_cleanup 63 unwind_protect_cleanup
72 72
73 function iargs = __find_patches__ (varargin) 73 function iargs = __find_patches__ (varargin)
74 iargs = []; 74 iargs = [];
75 i = 1; 75 i = 1;
76 while (i < nargin) 76 while (i < nargin)
77 iargs (end + 1) = i; 77 iargs(end + 1) = i;
78 if (ischar (varargin{i}) 78 if (ischar (varargin{i})
79 && (strcmpi (varargin{i}, "faces") 79 && (strcmpi (varargin{i}, "faces")
80 || strcmpi (varargin{i}, "vertices"))) 80 || strcmpi (varargin{i}, "vertices")))
81 i += 4; 81 i += 4;
82 elseif (isnumeric (varargin{i})) 82 elseif (isnumeric (varargin{i}))
94 i++; 94 i++;
95 break; 95 break;
96 elseif (ischar (varargin{i})) 96 elseif (ischar (varargin{i}))
97 colspec = tolower (varargin{i}); 97 colspec = tolower (varargin{i});
98 collen = length (colspec); 98 collen = length (colspec);
99 99 if (any (strncmp (colspec,
100 if (strncmp (colspec, "blue", collen) 100 {"blue", "black", "k", "red", "green", ...
101 || strncmp (colspec, "black", collen) 101 "yellow", "magenta", "cyan", "white"},
102 || strncmp (colspec, "k", collen) 102 collen)))
103 || strncmp (colspec, "black", collen)
104 || strncmp (colspec, "red", collen)
105 || strncmp (colspec, "green", collen)
106 || strncmp (colspec, "yellow", collen)
107 || strncmp (colspec, "magenta", collen)
108 || strncmp (colspec, "cyan", collen)
109 || strncmp (colspec, "white", collen))
110 i++; 103 i++;
111 break; 104 break;
112 endif 105 endif
113 else 106 else
114 i += 2; 107 i += 2;