Changeset 82 for trunk/src/plot_field.m


Ignore:
Timestamp:
Apr 15, 2010, 5:12:42 AM (14 years ago)
Author:
sommeria
Message:

mouse_up: improve zoom : keep the selected point at the same place on the graph
plot_field: memorize the max coordiantes on the graph (AxeData?) for zoom out
set_object: input possibilities extende to restrict menu (for mask objects)
uvmat: improvement of mask creation
civ: select mask option for civ2 when select(ed for civ1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r80 r82  
    10341034    end
    10351035end
    1036 
     1036%store the coordinate extrema occupied by the field
     1037test_lim=0;
     1038if test_vec
     1039    Xlim=[min(vec_X) max(vec_X)];
     1040    Ylim=[min(vec_Y) max(vec_Y)];
     1041    test_lim=1;
     1042    if test_ima%both background image and vectors coexist, take the wider bound
     1043        Xlim(1)=min(AX(1),Xlim(1));
     1044        Xlim(2)=max(AX(end),Xlim(2));
     1045        Ylim(1)=min(AY(end),Ylim(1));
     1046        Ylim(2)=max(AY(1),Ylim(2));
     1047    end
     1048elseif test_ima %only image plot
     1049    Xlim(1)=min(AX(1),AX(end));
     1050    Xlim(2)=max(AX(1),AX(end));
     1051    Ylim(1)=min(AY(1),AY(end));
     1052    Ylim(2)=max(AY(1),AY(end));
     1053    test_lim=1;
     1054end
     1055AxeData.RangeX=Xlim;
     1056AxeData.RangeY=Ylim;
    10371057% adjust the size of the plot to include the whole field, except if PlotParam.FixedLimits=1
    1038 if ~(isfield(PlotParam,'FixedLimits') && PlotParam.FixedLimits)
    1039     %~(exist('KeepLim','var') && isequal(KeepLim,1))  %adjust the graph limits*
    1040         test_lim=0;
    1041         if test_vec
    1042             Xlim=[min(vec_X) max(vec_X)];
    1043             Ylim=[min(vec_Y) max(vec_Y)];
    1044             test_lim=1;
    1045             if test_ima%both background image and vectors coexist, take the wider bound
    1046                 Xlim(1)=min(AX(1),Xlim(1));
    1047                 Xlim(2)=max(AX(end),Xlim(2));
    1048                 Ylim(1)=min(AY(end),Ylim(1));
    1049                 Ylim(2)=max(AY(1),Ylim(2));
    1050             end
    1051         elseif test_ima %only image plot
    1052             Xlim(1)=min(AX(1),AX(end));
    1053             Xlim(2)=max(AX(1),AX(end));
    1054             Ylim(1)=min(AY(1),AY(end));
    1055             Ylim(2)=max(AY(1),AY(end));
    1056             test_lim=1;
    1057         end
    1058         if test_lim
    1059             if Xlim(2)>Xlim(1)
    1060                 set(haxes,'XLim',Xlim);% set x limits of frame in axes coordinates
    1061             end
    1062             if Ylim(2)>Ylim(1)
    1063                 set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate
    1064             end
     1058if ~(isfield(PlotParam,'FixedLimits') && PlotParam.FixedLimits) && test_lim
     1059        if Xlim(2)>Xlim(1)
     1060            set(haxes,'XLim',Xlim);% set x limits of frame in axes coordinates
     1061        end
     1062        if Ylim(2)>Ylim(1)
     1063            set(haxes,'YLim',Ylim);% set y limits of frame in axes coordinate
    10651064        end
    10661065end
Note: See TracChangeset for help on using the changeset viewer.