Changeset 252 for trunk/src/plot_field.m


Ignore:
Timestamp:
May 15, 2011, 11:17:08 PM (13 years ago)
Author:
sommeria
Message:

various bugs corrected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r247 r252  
    241241    msgbox_uvmat('ERROR', errormsg)
    242242end
    243 if isfield(PlotParamOut,'RangeX')&& isfield(PlotParamOut,'RangeY')
     243if isfield(PlotParamOut,'MinX')
    244244%     'TESTplot'
    245245%     haxes
     
    248248%     set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX])
    249249%     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]
    252252end
    253253
     
    10711071%store the coordinate extrema occupied by the field
    10721072if ~isempty(Data)
     1073    XMin=[];
     1074    XMax=[];
     1075    YMin=[];
     1076    YMax=[];
    10731077    fix_lim=isfield(PlotParam,'FixLimits') && PlotParam.FixLimits;
    10741078    if fix_lim
    10751079        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;
    10771086        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
    10851089            XMin=min(AX);
    10861090            XMax=max(AX);
    10871091            YMin=min(AY);
    10881092            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
    10991109        PlotParamOut.MinX=XMin;
    11001110        PlotParamOut.MaxX=XMax;
     
    11071117            set(haxes,'YLim',[YMin YMax]);% set x limits of frame in axes coordinates
    11081118        end
    1109     end
     1119%     end
    11101120    set(haxes,'YDir','normal')
    11111121    set(get(haxes,'XLabel'),'String',[XName ' (' x_units ')']);
Note: See TracChangeset for help on using the changeset viewer.