Changeset 210 for trunk/src/plot_field.m
 Timestamp:
 Feb 28, 2011, 11:29:08 PM (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

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:
Note: See TracChangeset
for help on using the changeset viewer.