comparison scripts/plot/surface.m @ 13115:cd808de114c1

Allow surface and patch to be called w/o arguments. Adding and fixing tests. plot/line.m: Style fixes and test added. plot/patch.m: Tests added. plot/surface.m: Allow surface to be called w/o arguments. Tests added. plot/private/__patch__.m: Allow patch to be called w/o arguments.
author Kai Habel <kai.habel@gmx.de>
date Thu, 08 Sep 2011 15:43:40 +0200
parents 66af8b914607
children 2ea1658ad049
comparison
equal deleted inserted replaced
13114:7600200a54c8 13115:cd808de114c1
134 x = 1:nc; 134 x = 1:nc;
135 y = (1:nr)'; 135 y = (1:nr)';
136 else 136 else
137 error ("surface: Z argument must be a matrix"); 137 error ("surface: Z argument must be a matrix");
138 endif 138 endif
139 elseif (firststring == 1)
140 x = 1:3;
141 y = (x).';
142 c = z = eye(3);
139 else 143 else
140 bad_usage = true; 144 bad_usage = true;
141 endif 145 endif
142 146
143 if (! bad_usage) 147 if (! bad_usage)
156 160
157 endfunction 161 endfunction
158 162
159 ## Mark file as being tested. Tests for surface are in 163 ## Mark file as being tested. Tests for surface are in
160 ## surf.m, surfc.m, surfl.m, and pcolor.m 164 ## surf.m, surfc.m, surfl.m, and pcolor.m
161 %!assert(1) 165
166 %!test
167 %! hf = figure (1232, "visible", "off");
168 %! unwind_protect
169 %! h = surface;
170 %! assert (findobj (hf, "type", "surface"), h);
171 %! assert (get (h, "xdata"), 1:3, eps);
172 %! assert (get (h, "ydata"), (1:3)', eps);
173 %! assert (get (h, "zdata"), eye(3));
174 %! assert (get (h, "cdata"), eye(3));
175 %! assert (get (h, "type"), "surface");
176 %! assert (get (h, "linestyle"), get (0, "defaultsurfacelinestyle"));
177 %! assert (get (h, "linewidth"), get (0, "defaultsurfacelinewidth"), eps);
178 %! assert (get (h, "marker"), get (0, "defaultsurfacemarker"));
179 %! assert (get (h, "markersize"), get (0, "defaultsurfacemarkersize"));
180 %! unwind_protect_cleanup
181 %! close (hf);
182 %! end_unwind_protect