comparison scripts/plot/isocolors.m @ 11120:a44f979a35ce

style fixes for some .m files
author John W. Eaton <jwe@octave.org>
date Wed, 20 Oct 2010 20:49:17 -0400
parents 2c356a35d7f5
children fd0a3ac60b0e
comparison
equal deleted inserted replaced
11119:d3eaaa7c6762 11120:a44f979a35ce
98 98
99 ## Author: Martin Helm <martin@mhelm.de> 99 ## Author: Martin Helm <martin@mhelm.de>
100 100
101 function varargout = isocolors(varargin) 101 function varargout = isocolors(varargin)
102 calc_rgb = false; 102 calc_rgb = false;
103 switch nargin 103 switch (nargin)
104 case 2 104 case 2
105 c = varargin{1}; 105 c = varargin{1};
106 vp = varargin{2}; 106 vp = varargin{2};
107 x = 1:size (c, 2); 107 x = 1:size (c, 2);
108 y = 1:size (c, 1); 108 y = 1:size (c, 1);
139 v = vp; 139 v = vp;
140 elseif ( ishandle (vp) ) 140 elseif ( ishandle (vp) )
141 pa = vp; 141 pa = vp;
142 v = get (pa, "Vertices"); 142 v = get (pa, "Vertices");
143 else 143 else
144 error("isocolors: last argument is not a vertex list or patch handle"); 144 error ("isocolors: last argument is not a vertex list or patch handle");
145 endif 145 endif
146 if ( calc_rgb ) 146 if (calc_rgb)
147 new_col = zeros (size (v, 1), 3); 147 new_col = zeros (size (v, 1), 3);
148 new_col(:, 1) = __interp_cube__ (x, y, z, R, v, "values" ); 148 new_col(:,1) = __interp_cube__ (x, y, z, R, v, "values" );
149 new_col(:, 2) = __interp_cube__ (x, y, z, G, v, "values" ); 149 new_col(:,2) = __interp_cube__ (x, y, z, G, v, "values" );
150 new_col(:, 3) = __interp_cube__ (x, y, z, B, v, "values" ); 150 new_col(:,3) = __interp_cube__ (x, y, z, B, v, "values" );
151 else 151 else
152 new_col = __interp_cube__ (x, y, z, c, v, "values" ); 152 new_col = __interp_cube__ (x, y, z, c, v, "values" );
153 endif 153 endif
154 switch nargout 154 switch (nargout)
155 case 0 155 case 0
156 if (!isempty (pa)) 156 if (!isempty (pa))
157 set (pa, "FaceVertexCData", new_col); 157 set (pa, "FaceVertexCData", new_col);
158 endif 158 endif
159 case 1 159 case 1