Changeset 252 for trunk/src/plot_field.m
- Timestamp:
- May 15, 2011, 11:17:08 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_field.m
r247 r252 241 241 msgbox_uvmat('ERROR', errormsg) 242 242 end 243 if isfield(PlotParamOut,' RangeX')&& isfield(PlotParamOut,'RangeY')243 if isfield(PlotParamOut,'MinX') 244 244 % 'TESTplot' 245 245 % haxes … … 248 248 % set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX]) 249 249 % set(haxes,'YLim',[PlotParamOut.MinY PlotParamOut.MaxY]) 250 AxeData.RangeX= PlotParamOut.RangeX;%'[PlotParamOut.MinX PlotParamOut.MaxX];251 AxeData.RangeY= PlotParamOut.RangeY;%[PlotParamOut.MinY PlotParamOut.MaxY]250 AxeData.RangeX=[PlotParamOut.MinX PlotParamOut.MaxX];%'[PlotParamOut.MinX PlotParamOut.MaxX]; 251 AxeData.RangeY=[PlotParamOut.MinY PlotParamOut.MaxY];%[PlotParamOut.MinY PlotParamOut.MaxY] 252 252 end 253 253 … … 1071 1071 %store the coordinate extrema occupied by the field 1072 1072 if ~isempty(Data) 1073 XMin=[]; 1074 XMax=[]; 1075 YMin=[]; 1076 YMax=[]; 1073 1077 fix_lim=isfield(PlotParam,'FixLimits') && PlotParam.FixLimits; 1074 1078 if fix_lim 1075 1079 if ~isfield(PlotParam,'MinX')||~isfield(PlotParam,'MaxX')||~isfield(PlotParam,'MinY')||~isfield(PlotParam,'MaxY') 1076 fix_lim=0; %free limits if lits are not set, 1080 fix_lim=0; %free limits if limits are not set, 1081 else 1082 XMin=PlotParam.MinX 1083 XMax=PlotParam.MaxX; 1084 YMin=PlotParam.MinY; 1085 YMax=PlotParam.MaxY; 1077 1086 end %else PlotParamOut.XMin =PlotParam.XMin... 1078 end 1079 % if ~fix_lim 1080 XMin=[]; 1081 XMax=[]; 1082 YMin=[]; 1083 YMax=[]; 1084 if test_ima%both background image and vectors coexist, take the wider bound 1087 else 1088 if test_ima %both background image and vectors coexist, take the wider bound 1085 1089 XMin=min(AX); 1086 1090 XMax=max(AX); 1087 1091 YMin=min(AY); 1088 1092 YMax=max(AY); 1089 end 1090 if test_vec 1091 XMin=min(XMin,min(vec_X)); 1092 XMax=max(XMax,max(vec_X)); 1093 YMin=min(YMin,min(vec_Y)); 1094 YMax=max(YMax,max(vec_Y)); 1095 end 1096 PlotParamOut.RangeX=[XMin XMax]; %range of x, to be stored in the user data of the plot axes 1097 PlotParamOut.RangeY=[YMin YMax]; %range of x, to be stored in the user data of the plot axes 1098 if ~fix_lim 1093 if test_vec 1094 XMin=min(XMin,min(vec_X)); 1095 XMax=max(XMax,max(vec_X)); 1096 YMin=min(YMin,min(vec_Y)); 1097 YMax=max(YMax,max(vec_Y)); 1098 end 1099 elseif test_vec 1100 XMin=min(vec_X); 1101 XMax=max(vec_X); 1102 YMin=min(vec_Y); 1103 YMax=max(vec_Y); 1104 end 1105 end 1106 % PlotParamOut.RangeX=[XMin XMax]; %range of x, to be stored in the user data of the plot axes 1107 % PlotParamOut.RangeY=[YMin YMax]; %range of x, to be stored in the user data of the plot axes 1108 % if ~fix_lim 1099 1109 PlotParamOut.MinX=XMin; 1100 1110 PlotParamOut.MaxX=XMax; … … 1107 1117 set(haxes,'YLim',[YMin YMax]);% set x limits of frame in axes coordinates 1108 1118 end 1109 end1119 % end 1110 1120 set(haxes,'YDir','normal') 1111 1121 set(get(haxes,'XLabel'),'String',[XName ' (' x_units ')']);
Note: See TracChangeset
for help on using the changeset viewer.