- Timestamp:
- Feb 28, 2011, 11:29:08 PM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_down.m
r187 r210 72 72 73 73 %% loop on all the objects in the current figure (selected by the last mouse click) 74 %CurrentOrigin=get(hObject,'CurrentPoint') 74 75 for ichild=1:length(hchild) 75 76 obj_pos=get(hchild(ichild),'Position');%position of the object -
trunk/src/mouse_up.m
r204 r210 248 248 end 249 249 250 %% zoom in by a factor 2 if no new figure is created250 %% zoom in or out by a factor 2 if no new figure is created 251 251 if test_zoom 252 252 xy=get(currentaxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates 253 253 xlim=get(currentaxes,'XLim'); 254 254 ylim=get(currentaxes,'YLim'); 255 if isequal(get(currentfig,'SelectionType'),'normal');%if left button has been pressed 255 if isequal(get(currentfig,'SelectionType'),'normal');%if left button has been pressed, zoom in by a factor of 2 256 256 xlim(1)=0.5*xy(1,1)+0.5*xlim(1); 257 257 xlim(2)=0.5*xy(1,1)+0.5*xlim(2); … … 268 268 % ylim_new(1)=(1+alpha)*ylim(1)/2+(1-alpha)*ylim(2)/2; 269 269 % ylim_new(2)=(1-alpha)*ylim(1)/2+(1+alpha)*ylim(2)/2; 270 if isfield(AxeData,'RangeX') 270 if isfield(AxeData,'RangeX')&& isfield(AxeData,'RangeY') 271 271 xlim(1)=max(AxeData.RangeX(1),xlim(1)); 272 272 xlim(2)=min(AxeData.RangeX(2),xlim(2)); … … 276 276 set(hhuvmat.zoom,'Value',0) 277 277 set(hhuvmat.zoom,'BackgroundColor',[0.7 0.7 0.7]) 278 set(hhuvmat.Fix edLimits,'Value',0)279 set(hhuvmat.Fix edLimits,'BackgroundColor',[0.7 0.7 0.7])278 set(hhuvmat.FixLimits,'Value',0) 279 set(hhuvmat.FixLimits,'BackgroundColor',[0.7 0.7 0.7]) 280 280 end 281 281 end -
trunk/src/plot_field.m
r206 r210 241 241 end 242 242 if isfield(PlotParamOut,'MinX') 243 set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX]) 244 set(haxes,'YLim',[PlotParamOut.MinY PlotParamOut.MaxY]) 243 set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX]) 244 set(haxes,'YLim',[PlotParamOut.MinY PlotParamOut.MaxY]) 245 AxeData.RangeX=[PlotParamOut.MinX PlotParamOut.MaxX]; 246 AxeData.RangeY=[PlotParamOut.MinY PlotParamOut.MaxY]; 245 247 end 246 248 … … 522 524 function [haxes,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellVarIndex,VarTypeCell,haxes,PlotParam,PosColorbar) 523 525 %------------------------------------------------------------------- 524 525 526 grid(haxes, 'off') 526 527 %default plotting parameters … … 756 757 Aline=Aline(~isnan(A)); 757 758 if isempty(Aline) 758 errormsg= ['NaN input scalar or image in plot_field'];759 errormsg='NaN input scalar or image in plot_field'; 759 760 return 760 761 end 761 MinA=double(min(Aline)) 762 MinA=double(min(Aline)); 762 763 %MinA=double(min(min(A))); 763 764 else … … 769 770 Aline=Aline(~isnan(A)); 770 771 if isempty(Aline) 771 errormsg= ['NaN input scalar or image in plot_field'];772 errormsg='NaN input scalar or image in plot_field'; 772 773 return 773 774 end 774 775 end 775 MaxA=double(max(Aline)) 776 MaxA=double(max(Aline)); 776 777 % MaxA=double(max(max(A))); 777 778 else … … 969 970 vec_V=reshape(vec_V,1,numel(vec_V)); 970 971 MinMaxX=max(vec_X)-min(vec_X); 971 if ~isfield(PlotParam.Vectors,'AutoVec') || isequal(PlotParam.Vectors.AutoVec,0)|| ~isfield(PlotParam.Vectors,'VecScale')... 972 ||isempty(PlotParam.Vectors.VecScale)||~isa(PlotParam.Vectors.VecScale,'double') %automatic vector scale 973 % scale=[]; 974 if test_false %remove false vectors 975 %indsel=find(AxeData.FF==0);%indsel =indices of good vectors 976 else 972 if isfield(PlotParam.Vectors,'FixVec') && isequal(PlotParam.Vectors.FixVec,1)&& isfield(PlotParam.Vectors,'VecScale')... 973 &&~isempty(PlotParam.Vectors.VecScale) && isa(PlotParam.Vectors.VecScale,'double') %fixed vector scale 974 scale=PlotParam.Vectors.VecScale; %impose the length of vector representation 975 else 976 if ~test_false %remove false vectors 977 977 indsel=1:numel(vec_X);% 978 978 end … … 990 990 PlotParam.Vectors.VecScale=scale;%update the 'scale' display 991 991 end 992 else 993 scale=PlotParam.Vectors.VecScale; %impose the length of vector representation 994 end; 992 end 995 993 996 994 %record vectors on the plotting axes … … 1033 1031 colorlist(nbcolor,:)=[0 0 0]; %add black to the list of colors 1034 1032 if ~isempty(ivar_FF) 1035 ind_flag=find(vec_F~=1 & vec_F~=0 & vec_FF==0); %flag warning but not false 1033 % ind_flag=find(vec_F~=1 & vec_F~=0 & vec_FF==0); %flag warning but not false 1034 col_vec(vec_F~=1 & vec_F~=0 & vec_FF==0)=nbcolor; 1036 1035 else 1037 ind_flag=find(vec_F~=1 & vec_F~=0); 1036 % ind_flag=find(vec_F~=1 & vec_F~=0); 1037 col_vec(vec_F~=1 & vec_F~=0)=nbcolor; 1038 1038 end 1039 col_vec(ind_flag)=nbcolor;1039 % col_vec(ind_flag)=nbcolor; 1040 1040 end 1041 1041 nbcolor=nbcolor+1; 1042 1042 if ~isempty(ivar_FF) 1043 ind_flag=find(vec_FF~=0);1043 %ind_flag=find(vec_FF~=0); 1044 1044 if isfield(PlotParam.Vectors,'HideFalse') && PlotParam.Vectors.HideFalse==1 1045 1045 colorlist(nbcolor,:)=[NaN NaN NaN];% no plot of false vectors … … 1047 1047 colorlist(nbcolor,:)=[1 0 1];% magenta color 1048 1048 end 1049 col_vec( ind_flag)=nbcolor;1049 col_vec(vec_FF~=0)=nbcolor; 1050 1050 end 1051 1051 %plot vectors: -
trunk/src/uvmat.m
r206 r210 2389 2389 return 2390 2390 end 2391 'testUVMAT' 2392 UvData.Field 2393 [CellVarIndex,NbDim,VarType,errormsg]=find_field_indices(UvData.Field) 2391 [CellVarIndex,NbDim,VarType,errormsg]=find_field_indices(UvData.Field); 2394 2392 if ~isempty(errormsg) 2395 2393 errormsg=['error in uvmat/refresh_field/find_field_indices: ' errormsg]; … … 2397 2395 end 2398 2396 [NbDim,imax]=max(NbDim); 2399 VarType{imax} 2397 if isfield(UvData.Field,'NbDim') 2398 NbDim=UvData.Field.NbDim;% deal with plane fields containing z coordinates 2399 end 2400 2400 if ~isempty(VarType{imax}.coord_x) && ~isempty(VarType{imax}.coord_y) %unstructured coordinates 2401 2401 XName=UvData.Field.ListVarName{VarType{imax}.coord_x}; … … 3019 3019 end 3020 3020 if numel(RootFile_1)>=1 3021 if ~(isequal(RootFile_1(1),'/')| isequal(RootFile_1(1),'\'))3021 if ~(isequal(RootFile_1(1),'/')||isequal(RootFile_1(1),'\')) 3022 3022 RootFile_1(1)=[];%suppress possible / or \ separator 3023 3023 end … … 3176 3176 [FileName,RootPath,FileBase,FileIndices,FileExt_prev]=read_file_boxes_1(handles); 3177 3177 [P,F,str1,str2,str_a,str_b,E,NomType]=name2display(['xxx' get(handles.FileIndex,'String') FileExt_prev]); 3178 if isempty(FileExt_prev)| isequal(FileExt_prev,'')3178 if isempty(FileExt_prev)|| strcmp(FileExt_prev,'') 3179 3179 FileExt_1=get(handles.FileExt,'String'); 3180 3180 else … … 3182 3182 end 3183 3183 NomType_1=get(handles.FileIndex_1,'UserData'); 3184 if isempty(NomType_1)| isequal(NomType_1,'')3184 if isempty(NomType_1)|| strcmp(NomType_1,'') 3185 3185 NomType_1=get(handles.FileIndex,'UserData'); 3186 3186 end … … 4314 4314 ObjectData.enable_plot=1; 4315 4315 else 4316 4316 if isfield(ObjectData,'enable_plot') 4317 4317 ObjectData=rmfield(ObjectData,'enable_plot'); 4318 4318 end
Note: See TracChangeset
for help on using the changeset viewer.