Changeset 6976
- Timestamp:
- 01/06/11 13:47:17 (14 years ago)
- Location:
- issm/trunk/src/m/model/plot
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/model/plot/applyoptions.m
r6951 r6976 1 function applyoptions(md,data,options )1 function applyoptions(md,data,options,plothandle) 2 2 %APPLYOPTIONS - apply the options to current plot 3 3 % … … 138 138 c(:,2) = max(min( (0.1+c(:,1)).^(1/alpha) ,1),0); 139 139 c = hsv2rgb(c); 140 141 elseif strcmpi(cname,'Rignot2'), 142 c = hsv; 143 144 %adjust saturation 145 c = rgb2hsv(c); 146 alpha=getfieldvalue(options,'alpha',1); 147 c(:,2) = max(min( (0.1+c(:,1)).^(1/alpha) ,1),0); 148 c = hsv2rgb(c); 149 150 c=flipud(c); 140 151 141 152 else … … 373 384 %figurebackgrounbcolor 374 385 set(gcf,'color',getfieldvalue(options,'figurebackgroundcolor','w')); 386 387 %lighting 388 if strcmpi(getfieldvalue(options,'light','off'),'on'), 389 set(plothandle,'FaceLighting','gouraud','FaceColor','interp','AmbientStrength',0.5); 390 light('Position',[0 0.1 0.1],'Style','infinite'); 391 end -
issm/trunk/src/m/model/plot/plot_manager.m
r6751 r6976 166 166 167 167 %plot unit 168 plot_unit(x,y,z,elements,data2,is2d,datatype,options);168 h=plot_unit(x,y,z,elements,data2,is2d,datatype,options); 169 169 170 170 %apply all options … … 176 176 end 177 177 178 applyoptions(md,data2,options );178 applyoptions(md,data2,options,h); 179 179 180 180 %plot inset if requested … … 199 199 patch('Faces',[1 2 3 4 1],'Vertices',[X1([1 2 2 1])' Y1([1 1 2 2])' -10^10*ones(4,1)],'FaceColor','w','EdgeColor','k'); 200 200 hold on 201 plot_unit(x,y,z,elements,data2,is2d,datatype,options);201 h=plot_unit(x,y,z,elements,data2,is2d,datatype,options); 202 202 203 203 %applay options -
issm/trunk/src/m/model/plot/plot_unit.m
r6945 r6976 1 function plot_unit(x,y,z,elements,data,is2d,datatype,options)1 function h=plot_unit(x,y,z,elements,data,is2d,datatype,options) 2 2 %PLOT_UNIT - unit plot, display data 3 3 % 4 4 % Usage: 5 % plot_unit(x,y,z,elements,data,is2d,datatype,options);5 % h=plot_unit(x,y,z,elements,data,is2d,datatype,options); 6 6 % 7 7 % See also: PLOTMODEL, PLOT_MANAGER … … 22 22 if is2d, 23 23 A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 24 patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);24 h=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor); 25 25 else 26 26 A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6); 27 patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);27 h=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor); 28 28 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor); 29 29 patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor); … … 37 37 if is2d, 38 38 A=elements(:,1); B=elements(:,2); C=elements(:,3); 39 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);39 h=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor); 40 40 else 41 41 A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6); 42 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor);42 h=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor); 43 43 patch( 'Faces', [D E F], 'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor); 44 44 patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', data(:),'FaceColor','interp','EdgeColor',edgecolor); … … 60 60 61 61 if is2d, 62 patch( 'Faces',elements,'Vertices',[x y],'CData',data,'FaceColor','interp','EdgeColor',edgecolor);62 h=patch( 'Faces',elements,'Vertices',[x y],'CData',data,'FaceColor','interp','EdgeColor',edgecolor); 63 63 else 64 64 A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6); 65 patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor);65 h=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor); 66 66 patch( 'Faces', [D E F], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor); 67 67 patch( 'Faces', [A B E D], 'Vertices', [x y z],'CData', data,'FaceColor','interp','EdgeColor',edgecolor);
Note:
See TracChangeset
for help on using the changeset viewer.