Changeset 411 for trunk/src/plot_field.m


Ignore:
Timestamp:
May 7, 2012, 3:32:21 PM (9 years ago)
Author:
sommeria
Message:

bugs corrected in uvmat: fixed x/y and calc_field for the new PIV data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r405 r411  
    100100PlotType='text'; %default
    101101PlotParamOut=PlotParam;%default
    102 Coordinates=[];
    103 if isfield(PlotParam,'Coordinates')
    104 Coordinates=PlotParam.Coordinates;
     102if ~isfield(PlotParam,'Coordinates')
     103    PlotParam.Coordinates=[];
    105104end
    106105
     
    193192   
    194193    %% set axes properties
    195     if isfield(Coordinates,'CheckFixLimits') && isequal(Coordinates.CheckFixLimits,1)  %adjust the graph limits
     194    if isfield(PlotParam.Coordinates,'CheckFixLimits') && isequal(PlotParam.Coordinates.CheckFixLimits,1)  %adjust the graph limits
    196195        set(haxes,'XLimMode', 'manual')
    197196        set(haxes,'YLimMode', 'manual')
     
    200199        set(haxes,'YLimMode', 'auto')
    201200    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)
    206205        set(haxes,'DataAspectRatioMode','manual')
    207206        set(haxes,'DataAspectRatio',[1 1 1])
     
    228227        end
    229228    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);%
    231230        if testzoomaxes
    232231            [zoomaxes,Coordinates]=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),zoomaxes,PlotParam.Coordinates);
     
    499498function [haxes,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellVarIndex,VarTypeCell,haxes,PlotParam,PosColorbar)
    500499%-------------------------------------------------------------------
    501 grid(haxes, 'off')
     500
     501grid(haxes, 'off')% remove grid (possibly remaining from other graphs)
    502502%default plotting parameters
    503503PlotType='plane';%default
     
    505505    PlotParam=[];
    506506end
    507 if ~isfield(PlotParam,'Coordinates')
    508     PlotParam.Coordinates=[];
    509 end
     507
    510508if ~isfield(PlotParam,'Scalar')
    511509    PlotParam.Scalar=[];
     
    866864                hima=imagesc(AX,AY,B,[MaxA-1 MaxA]);
    867865            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')
    869874            set(haxes,'Tag',tag);%preserve the axes tag (removed by image fct !!!)     
    870875            uistack(hima, 'bottom')
Note: See TracChangeset for help on using the changeset viewer.