Changeset 82 for trunk/src/plot_field.m
- Timestamp:
- Apr 15, 2010, 5:12:42 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_field.m
r80 r82 1034 1034 end 1035 1035 end 1036 1036 %store the coordinate extrema occupied by the field 1037 test_lim=0; 1038 if test_vec 1039 Xlim=[min(vec_X) max(vec_X)]; 1040 Ylim=[min(vec_Y) max(vec_Y)]; 1041 test_lim=1; 1042 if test_ima%both background image and vectors coexist, take the wider bound 1043 Xlim(1)=min(AX(1),Xlim(1)); 1044 Xlim(2)=max(AX(end),Xlim(2)); 1045 Ylim(1)=min(AY(end),Ylim(1)); 1046 Ylim(2)=max(AY(1),Ylim(2)); 1047 end 1048 elseif test_ima %only image plot 1049 Xlim(1)=min(AX(1),AX(end)); 1050 Xlim(2)=max(AX(1),AX(end)); 1051 Ylim(1)=min(AY(1),AY(end)); 1052 Ylim(2)=max(AY(1),AY(end)); 1053 test_lim=1; 1054 end 1055 AxeData.RangeX=Xlim; 1056 AxeData.RangeY=Ylim; 1037 1057 % adjust the size of the plot to include the whole field, except if PlotParam.FixedLimits=1 1038 if ~(isfield(PlotParam,'FixedLimits') && PlotParam.FixedLimits) 1039 %~(exist('KeepLim','var') && isequal(KeepLim,1)) %adjust the graph limits* 1040 test_lim=0; 1041 if test_vec 1042 Xlim=[min(vec_X) max(vec_X)]; 1043 Ylim=[min(vec_Y) max(vec_Y)]; 1044 test_lim=1; 1045 if test_ima%both background image and vectors coexist, take the wider bound 1046 Xlim(1)=min(AX(1),Xlim(1)); 1047 Xlim(2)=max(AX(end),Xlim(2)); 1048 Ylim(1)=min(AY(end),Ylim(1)); 1049 Ylim(2)=max(AY(1),Ylim(2)); 1050 end 1051 elseif test_ima %only image plot 1052 Xlim(1)=min(AX(1),AX(end)); 1053 Xlim(2)=max(AX(1),AX(end)); 1054 Ylim(1)=min(AY(1),AY(end)); 1055 Ylim(2)=max(AY(1),AY(end)); 1056 test_lim=1; 1057 end 1058 if test_lim 1059 if Xlim(2)>Xlim(1) 1060 set(haxes,'XLim',Xlim);% set x limits of frame in axes coordinates 1061 end 1062 if Ylim(2)>Ylim(1) 1063 set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate 1064 end 1058 if ~(isfield(PlotParam,'FixedLimits') && PlotParam.FixedLimits) && test_lim 1059 if Xlim(2)>Xlim(1) 1060 set(haxes,'XLim',Xlim);% set x limits of frame in axes coordinates 1061 end 1062 if Ylim(2)>Ylim(1) 1063 set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate 1065 1064 end 1066 1065 end
Note: See TracChangeset
for help on using the changeset viewer.