Changeset 221 for trunk/src/plot_field.m


Ignore:
Timestamp:
Mar 12, 2011, 11:11:01 PM (10 years ago)
Author:
sommeria
Message:

various bug corrections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r210 r221  
    240240    msgbox_uvmat('ERROR', errormsg)
    241241end
    242 if isfield(PlotParamOut,'MinX')
    243     set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX])
    244     set(haxes,'YLim',[PlotParamOut.MinY PlotParamOut.MaxY])
    245     AxeData.RangeX=[PlotParamOut.MinX PlotParamOut.MaxX];
    246     AxeData.RangeY=[PlotParamOut.MinY PlotParamOut.MaxY];
     242if isfield(PlotParamOut,'RangeX')&& isfield(PlotParamOut,'RangeY')
     243%     'TESTplot'
     244%     haxes
     245%     PlotParamOut.MinX
     246%     PlotParamOut.MaxY
     247%     set(haxes,'XLim',[PlotParamOut.MinX PlotParamOut.MaxX])
     248%     set(haxes,'YLim',[PlotParamOut.MinY PlotParamOut.MaxY])
     249    AxeData.RangeX=PlotParamOut.RangeX;%'[PlotParamOut.MinX PlotParamOut.MaxX];
     250    AxeData.RangeY=PlotParamOut.RangeY;%[PlotParamOut.MinY PlotParamOut.MaxY]
    247251end
    248252
     
    508512
    509513%% determine axes bounds
    510  fix_lim=isfield(PlotParam,'FixLimits') && PlotParam.FixLimits;
     514PlotParamOut.RangeX=[min(XMin) max(XMax)];
     515PlotParamOut.RangeY=[min(YMin_cell) max(YMax_cell)];
     516fix_lim=isfield(PlotParam,'FixLimits') && PlotParam.FixLimits;
    511517if fix_lim
    512518    if ~isfield(PlotParam,'MinX')||~isfield(PlotParam,'MaxX')||~isfield(PlotParam,'MinY')||~isfield(PlotParam,'MaxY')
    513519        fix_lim=0; %free limits if lits are not set,
    514     end  %else PlotParamOut.XMin =PlotParam.XMin...
     520    end
    515521end
    516522if ~fix_lim
     
    10741080        end  %else PlotParamOut.XMin =PlotParam.XMin...
    10751081    end
    1076     if ~fix_lim
     1082%     if ~fix_lim
    10771083        XMin=[];
    10781084        XMax=[];
     
    10911097            YMax=[YMax max(vec_Y)];
    10921098        end
     1099        PlotParamOut.RangeX=[min(XMin) max(XMax)]; %range of x, to be stored in the user data of the plot axes
     1100        PlotParamOut.RangeY=[min(YMin) max(YMax)]; %range of x, to be stored in the user data of the plot axes
     1101    if ~fix_lim
    10931102        PlotParamOut.MinX=min(XMin);
    10941103        PlotParamOut.MaxX=max(XMax);
     
    11021111        end
    11031112    end
    1104 %     if Ylim(2)>Ylim(1)
    1105 %         set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate
    1106 %     end
    1107 %     end
    1108     %    adjust the size of the plot to include the whole field, except if PlotParam.FixLimits=1
    1109     %     if ~(isfield(PlotParam,'FixLimits') && PlotParam.FixLimits) && test_lim
    1110     %         PlotParamOut.MinX=Xlim(1);
    1111     %         PlotParamOut.MaxX=Xlim(2);
    1112     %         PlotParamOut.MinY=Ylim(1);
    1113     %         PlotParamOut.MaxY=Ylim(2);
    1114 %     if Xlim(2)>Xlim(1)
    1115 %         set(haxes,'XLim',Xlim);% set x limits of frame in axes coordinates
    1116 %     end
    1117 %     if Ylim(2)>Ylim(1)
    1118 %         set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate
    1119 %     end
    1120     %     end
    1121 
    11221113    set(haxes,'YDir','normal')
    11231114    set(get(haxes,'XLabel'),'String',[XName ' (' x_units ')']);
Note: See TracChangeset for help on using the changeset viewer.