Changeset 206 for trunk/src/plot_field.m
- Timestamp:
- Feb 27, 2011, 10:40:29 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_field.m
r201 r206 159 159 return 160 160 end 161 index_2D=find(NbDim==2,2);%find 2D fields (at most 2) 161 162 index_3D=find(NbDim>2,1); 162 163 if ~isempty(index_3D) 164 if isfield(Data,'NbDim')&& isequal(Data.NbDim,2) 165 index_2D=[index_2D index_3D]; 166 else 163 167 msgbox_uvmat('ERROR','volume plot not implemented yet'); 164 168 return 165 end 166 index_2D=find(NbDim==2,2);%find 2D fields (at most 2) 169 end 170 end 171 167 172 index_1D=find(NbDim==1); 168 173 index_0D=find(NbDim==0); … … 243 248 set(haxes,'UserData',AxeData) 244 249 245 %% update the p arametersstored in parent figure250 %% update the plotted field stored in parent figure 246 251 FigData=get(hfig,'UserData'); 247 252 tagaxes=get(haxes,'tag'); … … 562 567 VarType.coord=VarType.coord(ind_coord); 563 568 end 564 % idim_Y=[];565 % test_grid=0;566 569 if ~isempty(ivar_U) && ~isempty(ivar_V)% vector components detected 567 570 if test_vec … … 725 728 siz=3;%color image 726 729 else 727 errormsg=['unrecognized scalar type :' num2str(np(3)) ' color components'];730 errormsg=['unrecognized scalar type in plot_field: considered as 2D field with ' num2str(np(3)) ' color components']; 728 731 return 729 732 end … … 748 751 PlotParam.Scalar.MaxA=[];%default 749 752 end 753 Aline=[]; 750 754 if isequal(PlotParam.Scalar.FixScal,0)||isempty(PlotParam.Scalar.MinA)||~isa(PlotParam.Scalar.MinA,'double') %correct if there is no numerical data in edit box 751 MinA=double(min(min(A))); 755 Aline=reshape(A,1,[]); 756 Aline=Aline(~isnan(A)); 757 if isempty(Aline) 758 errormsg=['NaN input scalar or image in plot_field']; 759 return 760 end 761 MinA=double(min(Aline)) 762 %MinA=double(min(min(A))); 752 763 else 753 MinA=PlotParam.Scalar.MinA; 764 MinA=PlotParam.Scalar.MinA; 754 765 end; 755 766 if isequal(PlotParam.Scalar.FixScal,0)||isempty(PlotParam.Scalar.MaxA)||~isa(PlotParam.Scalar.MaxA,'double') %correct if there is no numerical data in edit box 756 MaxA=double(max(max(A))); 767 if isempty(Aline) 768 Aline=reshape(A,1,[]); 769 Aline=Aline(~isnan(A)); 770 if isempty(Aline) 771 errormsg=['NaN input scalar or image in plot_field']; 772 return 773 end 774 end 775 MaxA=double(max(Aline)) 776 % MaxA=double(max(max(A))); 757 777 else 758 778 MaxA=PlotParam.Scalar.MaxA;
Note: See TracChangeset
for help on using the changeset viewer.