Changeset 748 for trunk/src/plot_field.m
- Timestamp:
- Apr 23, 2014, 4:57:58 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_field.m
r735 r748 45 45 % PlotParam: structure containing the parameters for plotting, as read on the uvmat or view_field GUI (by function 'read_GUI.m'). 46 46 % Contains three substructures: 47 % . Coordinates: coordinate parameters:47 % .Axes: coordinate parameters: 48 48 % .CheckFixLimits:=0 (default) adjust axes limit to the X,Y data, =1: preserves the previous axes limits 49 % . Coordinates.CheckFixAspectRatio: =0 (default):automatic adjustment of the graph, keep 1 to 1 aspect ratio for x and y scales.50 % . Coordinates.AspectRatio: imposed aspect ratio y/x of axis unit plots49 % .Axes.CheckFixAspectRatio: =0 (default):automatic adjustment of the graph, keep 1 to 1 aspect ratio for x and y scales. 50 % .Axes.AspectRatio: imposed aspect ratio y/x of axis unit plots 51 51 % --scalars-- 52 52 % .Scalar.MaxA: upper bound (saturation color) for the scalar representation, max(field) by default … … 103 103 PlotType='text'; %default 104 104 if ~isfield(PlotParam,'Coordinates') 105 PlotParam. Coordinates=[];105 PlotParam.Axes=[]; 106 106 if isfield(Data,'CoordUnit') 107 PlotParam. Coordinates.CheckFixAspectRatio=1;108 PlotParam. Coordinates.AspectRatio=1; %set axes equal by default if CoordUnit is defined107 PlotParam.Axes.CheckFixAspectRatio=1; 108 PlotParam.Axes.AspectRatio=1; %set axes equal by default if CoordUnit is defined 109 109 end 110 110 end … … 160 160 161 161 %% set axes properties 162 if isfield(PlotParamOut. Coordinates,'CheckFixLimits') && isequal(PlotParamOut.Coordinates.CheckFixLimits,1) %adjust the graph limits162 if isfield(PlotParamOut.Axes,'CheckFixLimits') && isequal(PlotParamOut.Axes.CheckFixLimits,1) %adjust the graph limits 163 163 set(haxes,'XLimMode', 'manual') 164 164 set(haxes,'YLimMode', 'manual') … … 193 193 CheckHold= PlotParam.CheckHold; 194 194 end 195 PlotParamOut. Coordinates=plot_profile(Data,CellInfo(index_1D),haxes,PlotParamOut.Coordinates,CheckHold);%195 PlotParamOut.Axes=plot_profile(Data,CellInfo(index_1D),haxes,PlotParamOut.Axes,CheckHold);% 196 196 if testzoomaxes 197 [zoomaxes,PlotParamOut. Coordinates]=plot_profile(Data,CellInfo(index_1D),zoomaxes,PlotParamOut.Coordinates,CheckHold);197 [zoomaxes,PlotParamOut.Axes]=plot_profile(Data,CellInfo(index_1D),zoomaxes,PlotParamOut.Axes,CheckHold); 198 198 AxeData.ZoomAxes=zoomaxes; 199 199 end … … 897 897 end 898 898 899 if isfield(PlotParam. Coordinates,'CheckFixAspectRatio') && isequal(PlotParam.Coordinates.CheckFixAspectRatio,1)899 if isfield(PlotParam.Axes,'CheckFixAspectRatio') && isequal(PlotParam.Axes.CheckFixAspectRatio,1) 900 900 set(haxes,'DataAspectRatioMode','manual') 901 if isfield(PlotParam. Coordinates,'AspectRatio')902 set(haxes,'DataAspectRatio',[PlotParam. Coordinates.AspectRatio 1 1])901 if isfield(PlotParam.Axes,'AspectRatio') 902 set(haxes,'DataAspectRatio',[PlotParam.Axes.AspectRatio 1 1]) 903 903 else 904 904 set(haxes,'DataAspectRatio',[1 1 1]) … … 1167 1167 MinY=[]; 1168 1168 MaxY=[]; 1169 fix_lim=isfield(PlotParam. Coordinates,'CheckFixLimits') && PlotParam.Coordinates.CheckFixLimits;1169 fix_lim=isfield(PlotParam.Axes,'CheckFixLimits') && PlotParam.Axes.CheckFixLimits; 1170 1170 if fix_lim 1171 if isfield(PlotParam. Coordinates,'MinX')&&isfield(PlotParam.Coordinates,'MaxX')&&isfield(PlotParam.Coordinates,'MinY')&&isfield(PlotParam.Coordinates,'MaxY')1172 MinX=PlotParam. Coordinates.MinX;1173 MaxX=PlotParam. Coordinates.MaxX;1174 MinY=PlotParam. Coordinates.MinY;1175 MaxY=PlotParam. Coordinates.MaxY;1171 if isfield(PlotParam.Axes,'MinX')&&isfield(PlotParam.Axes,'MaxX')&&isfield(PlotParam.Axes,'MinY')&&isfield(PlotParam.Axes,'MaxY') 1172 MinX=PlotParam.Axes.MinX; 1173 MaxX=PlotParam.Axes.MaxX; 1174 MinY=PlotParam.Axes.MinY; 1175 MaxY=PlotParam.Axes.MaxY; 1176 1176 end %else PlotParamOut.MinX =PlotParam.MinX... 1177 1177 else … … 1194 1194 end 1195 1195 end 1196 PlotParamOut. Coordinates.MinX=MinX;1197 PlotParamOut. Coordinates.MaxX=MaxX;1198 PlotParamOut. Coordinates.MinY=MinY;1199 PlotParamOut. Coordinates.MaxY=MaxY;1196 PlotParamOut.Axes.MinX=MinX; 1197 PlotParamOut.Axes.MaxX=MaxX; 1198 PlotParamOut.Axes.MinY=MinY; 1199 PlotParamOut.Axes.MaxY=MaxY; 1200 1200 if MaxX>MinX 1201 1201 set(haxes,'XLim',[MinX MaxX]);% set x limits of frame in axes coordinates … … 1207 1207 set(get(haxes,'XLabel'),'String',[XName ' (' x_units ')']); 1208 1208 set(get(haxes,'YLabel'),'String',[YName ' (' y_units ')']); 1209 PlotParamOut. Coordinates.x_units=x_units;1210 PlotParamOut. Coordinates.y_units=y_units;1211 end 1212 if isfield(PlotParam,'Coordinates') && isfield(PlotParam. Coordinates,'CheckFixAspectRatio') && isequal(PlotParam.Coordinates.CheckFixAspectRatio,1)1209 PlotParamOut.Axes.x_units=x_units; 1210 PlotParamOut.Axes.y_units=y_units; 1211 end 1212 if isfield(PlotParam,'Coordinates') && isfield(PlotParam.Axes,'CheckFixAspectRatio') && isequal(PlotParam.Axes.CheckFixAspectRatio,1) 1213 1213 set(haxes,'DataAspectRatioMode','manual') 1214 if isfield(PlotParam. Coordinates,'AspectRatio')1215 set(haxes,'DataAspectRatio',[PlotParam. Coordinates.AspectRatio 1 1])1214 if isfield(PlotParam.Axes,'AspectRatio') 1215 set(haxes,'DataAspectRatio',[PlotParam.Axes.AspectRatio 1 1]) 1216 1216 end 1217 1217 else
Note: See TracChangeset
for help on using the changeset viewer.