Mercurial > hg > octave-nkf
comparison scripts/plot/draw/fill.m @ 18403:d7c88126ac03
fill.m: Don't replicate cdata matrix to x,y size when it is a string.
* fill.m: Don't replicate cdata matrix to x,y size when it is a string.
Add new demo using replication of cdata.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 22 Jan 2014 18:03:44 -0800 |
parents | b4b5ee91561a |
children | 15487cae60a3 |
comparison
equal
deleted
inserted
replaced
18402:6165053c56b3 | 18403:d7c88126ac03 |
---|---|
92 set (hax, "nextplot", "add"); | 92 set (hax, "nextplot", "add"); |
93 | 93 |
94 for i = 1 : length (iargs) | 94 for i = 1 : length (iargs) |
95 cdata = varargin{iargs(i) + 2}; | 95 cdata = varargin{iargs(i) + 2}; |
96 ## For Matlab compatibility, replicate cdata to match size of data | 96 ## For Matlab compatibility, replicate cdata to match size of data |
97 if (iscolumn (cdata)) | 97 if (iscolumn (cdata) && ! ischar (cdata)) |
98 sz = size (varargin{iargs(i)}); | 98 sz = size (varargin{iargs(i)}); |
99 if (all (sz > 1)) | 99 if (all (sz > 1)) |
100 cdata = repmat (cdata, [1, sz(2)]); | 100 cdata = repmat (cdata, [1, sz(2)]); |
101 endif | 101 endif |
102 endif | 102 endif |
159 %! y1 = cos (t1); | 159 %! y1 = cos (t1); |
160 %! x2 = sin (t2) + 0.8; | 160 %! x2 = sin (t2) + 0.8; |
161 %! y2 = cos (t2); | 161 %! y2 = cos (t2); |
162 %! h = fill (x1,y1,'r', x2,y2,'g'); | 162 %! h = fill (x1,y1,'r', x2,y2,'g'); |
163 | 163 |
164 %!demo | |
165 %! clf; | |
166 %! x = [0 0 | |
167 %! 1 0.5 | |
168 %! 1 0.5 | |
169 %! 0 0]; | |
170 %! y = [0 0 | |
171 %! 0 0 | |
172 %! 1 0.5 | |
173 %! 1 0.5]; | |
174 %! c = [1 2 3 4]'; | |
175 %! fill (x, y, c); |