Ignore:
Timestamp:
Apr 5, 2011, 12:46:34 AM (10 years ago)
Author:
sommeria
Message:

interactive test for piv introduced various bug corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_object.m

    r187 r231  
    7070        test_newobj=0;
    7171        haxes=get(hplot,'parent');
     72        currentfig=get(haxes,'parent');
    7273    elseif isequal(get(hplot,'Type'),'axes')% hplot is the handle of an axis
     74        haxes=hplot;
    7375        currentfig=get(hplot,'parent');
    74         set(0,'CurrentFigure',currentfig)
    75         haxes=hplot;
    76         set(currentfig,'CurrentAxes',haxes);
     76%         set(0,'CurrentFigure',currentfig)
     77     
     78%         set(currentfig,'CurrentAxes',haxes);
    7779    elseif isequal(get(hplot,'Type'),'figure')% hplot is the handle of a figure
    7880        set(0,'CurrentFigure',hplot);%set the input figure as the current one
    7981        haxes=findobj(hplot,'Type','axes');%look for axes in the figure
    8082        haxes=haxes(1);
    81         set(hplot,'CurrentAxes',haxes);%set the first found axis as the current one
     83        currentfig=hplot;
     84       % set(hplot,'CurrentAxes',haxes);%set the first found axis as the current one
    8285    else
    83         figure; %create new figure
     86        currentfig=figure; %create new figure
    8487        hplot=axes;%create new axes
    8588        haxes=hplot;
    8689    end
    8790else
    88     figure; %create new figure
     91    currentfig=figure; %create new figure
    8992    hplot=axes;%create new axes
    9093    haxes=hplot;
    9194end
     95set(0,'CurrentFigure',currentfig)%set the currentfigure as the current one
     96set(currentfig,'CurrentAxes',haxes);%set the current axes in the current figure
    9297
    9398%% default input parameters
     
    333338%% create the object
    334339if test_newobj
    335     axes(haxes)
     340%     axes(haxes)
    336341    hother=findobj('Tag','proj_object');%find all the proj objects
    337342    for iobj=1:length(hother)
Note: See TracChangeset for help on using the changeset viewer.