Changeset 411 for trunk/src/plot_field.m
- Timestamp:
- May 7, 2012, 3:32:21 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_field.m
r405 r411 100 100 PlotType='text'; %default 101 101 PlotParamOut=PlotParam;%default 102 Coordinates=[]; 103 if isfield(PlotParam,'Coordinates') 104 Coordinates=PlotParam.Coordinates; 102 if ~isfield(PlotParam,'Coordinates') 103 PlotParam.Coordinates=[]; 105 104 end 106 105 … … 193 192 194 193 %% set axes properties 195 if isfield( Coordinates,'CheckFixLimits') && isequal(Coordinates.CheckFixLimits,1) %adjust the graph limits194 if isfield(PlotParam.Coordinates,'CheckFixLimits') && isequal(PlotParam.Coordinates.CheckFixLimits,1) %adjust the graph limits 196 195 set(haxes,'XLimMode', 'manual') 197 196 set(haxes,'YLimMode', 'manual') … … 200 199 set(haxes,'YLimMode', 'auto') 201 200 end 202 if ~isfield( Coordinates,'CheckFixEqual')&& isfield(Data,'CoordUnit')203 Coordinates.CheckFixEqual=1;204 end 205 if isfield( Coordinates,'CheckFixEqual') && isequal(Coordinates.CheckFixEqual,1)201 if ~isfield(PlotParam.Coordinates,'CheckFixEqual')&& isfield(Data,'CoordUnit') 202 PlotParam.Coordinates.CheckFixEqual=1;% if CoordUnit is defined, the two coordiantes should be plotted with equal scale by default 203 end 204 if isfield(PlotParam.Coordinates,'CheckFixEqual') && isequal(PlotParam.Coordinates.CheckFixEqual,1) 206 205 set(haxes,'DataAspectRatioMode','manual') 207 206 set(haxes,'DataAspectRatio',[1 1 1]) … … 228 227 end 229 228 else 230 Coordinates=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),haxes, Coordinates);%229 Coordinates=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),haxes,PlotParam.Coordinates);% 231 230 if testzoomaxes 232 231 [zoomaxes,Coordinates]=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),zoomaxes,PlotParam.Coordinates); … … 499 498 function [haxes,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellVarIndex,VarTypeCell,haxes,PlotParam,PosColorbar) 500 499 %------------------------------------------------------------------- 501 grid(haxes, 'off') 500 501 grid(haxes, 'off')% remove grid (possibly remaining from other graphs) 502 502 %default plotting parameters 503 503 PlotType='plane';%default … … 505 505 PlotParam=[]; 506 506 end 507 if ~isfield(PlotParam,'Coordinates') 508 PlotParam.Coordinates=[]; 509 end 507 510 508 if ~isfield(PlotParam,'Scalar') 511 509 PlotParam.Scalar=[]; … … 866 864 hima=imagesc(AX,AY,B,[MaxA-1 MaxA]); 867 865 end 868 set(hima,'Tag','ima','HitTest','off') 866 % the function imagesc reset the axes 'DataAspectRatioMode'='auto', change if .CheckFixEqual is 867 % requested: 868 if isfield(PlotParam.Coordinates,'CheckFixEqual') && isequal(PlotParam.Coordinates.CheckFixEqual,1) 869 set(haxes,'DataAspectRatioMode','manual') 870 set(haxes,'DataAspectRatio',[1 1 1]) 871 end 872 set(hima,'Tag','ima') 873 set(hima,'HitTest','off') 869 874 set(haxes,'Tag',tag);%preserve the axes tag (removed by image fct !!!) 870 875 uistack(hima, 'bottom')
Note: See TracChangeset
for help on using the changeset viewer.