function extractaxes(hObject, eventdata, parentfig, Empty_Button, Buttons, AxesD, AxesAFS, AxesSOL, usmn, usmf)
data = get(Empty_Button,'UserData');
SelTyp = get(gcbf, 'SelectionType');

if strcmp(SelTyp,'alt') == 1
    pt = get(hObject, 'CurrentPoint');
    sz = get(hObject, 'Position');
    x = pt(1,1:2)./sz(1,3:4);
    
    posD   = get(AxesD, 'Position');
    posAFS1 = get(AxesAFS, 'Position');
    posSOL = get(AxesSOL, 'Position');
    
    if (posD(1) < x(1)) && (x(1) < posD(1)+posD(3)) && (posD(2) < x(2)) && (x(2) < posD(2)+posD(4))
        tmpc = figure;
        copyobj(AxesD,tmpc);
        tmpa = get(tmpc,'CurrentAxes');
        set(tmpa,'position',[0.15 0.15 0.75 0.75]);
        title(tmpa, 'data');
        ylabel(tmpa, 'absorption');
        
              
    elseif (posSOL(1) < x(1)) && (x(1) < posSOL(1)+posSOL(3)) && (posSOL(2) < x(2)) && (x(2) < posSOL(2)+posSOL(4))
        tmpc = figure;
        copyobj(AxesSOL,tmpc);
        tmpa = get(tmpc,'CurrentAxes');
        set(tmpa,'position',[0.15 0.15 0.75 0.75]);
        title(tmpa, 'Solution');
        
    elseif (posAFS1(1) < x(1)) && (x(1) < posAFS1(1)+posAFS1(3)) && (posAFS1(2) < x(2)) && (x(2) < posAFS1(2)+posAFS1(4)) 
        tmpc = figure;
        copyobj(AxesAFS,tmpc);
        tmpa = get(tmpc,'CurrentAxes');
        set(tmpa,'position',[0.15 0.15 0.75 0.75]);
        title(tmpa, 'AFS');
        xlabel(tmpa,'x','interpreter','tex');
        ylabel(tmpa,'y','interpreter','tex');
  
    end
elseif get(usmn, 'Value') == 1
    if (isfield(data,'isExpert1') == 0) || (data.isExpert1 == 0)
        if data.scalBorg==1
                pt = get(AxesAFS, 'CurrentPoint');
                data.FixPoint1_B = pt(1,1:2);
                
                V1=data.V_scal;
                VTV = V1'*data.Vraw;
                s1=data.sum_v1;
                s2=data.sum_v2;
                s3=data.sum_v3;
                
                t(2:3)=data.FixPoint1_B;
                t(1)=(1-t(2)*s2-t(3)*s3)/s1;
                s=t*VTV;
                s=s/s(1);
                data.FixPoint1_SV(1:2)=s(2:3);
                
            else
                pt = get(AxesAFS, 'CurrentPoint');
                data.FixPoint1_SV = pt(1,1:2);
                
                [h,n]=size(data.Vraw);
                e=ones(h,1);
                t1=[1,data.FixPoint1_SV(1),data.FixPoint1_SV(2)];
                
                h=t1*data.Vraw(:,1:3)';
                s=h*e;
                V1=data.V_scal;
                t2=h*V1/s;
                data.FixPoint1_B(1:2)=t2(2:3);
        end
        

            
        actpwd = pwd;
        cd(data.calcp);
        
       if data.Borgen==1
            dlmwrite('subfcnsBKP/wrap/FixPoint1.txt',data.FixPoint1_B','precision','%15.15e');
       else
            dlmwrite('subfcnsBKP/wrap/FixPoint1.txt',data.FixPoint1_SV','precision','%15.15e');
       end
        
        cd(actpwd);
        set(Empty_Button,'UserData',data);
        plotAFS_BKP(Empty_Button,AxesAFS);
        
        if data.scalBorg==1
            hold(AxesAFS, 'on');
            plot(AxesAFS,data.FixPoint1_B(1),data.FixPoint1_B(2),'kx','Linewidth',2);
            hold(AxesAFS, 'off');
        else
            hold(AxesAFS, 'on');
            plot(AxesAFS,data.FixPoint1_SV(1),data.FixPoint1_SV(2),'kx','Linewidth',2);
            hold(AxesAFS, 'off');
        end
        set(usmn, 'Value', 0);
        set(usmf, 'Value', 1);
        
        
        
    elseif (isfield(data,'isExpert2') == 0) || (data.isExpert2 == 0)
        if data.scalBorg==1
                pt = get(AxesAFS, 'CurrentPoint');
                data.FixPoint2_B = pt(1,1:2);
                
                V1=data.V_scal;
                VTV = V1'*data.Vraw;
                s1=data.sum_v1;
                s2=data.sum_v2;
                s3=data.sum_v3;
                
                t(2:3)=data.FixPoint2_B;
                t(1)=(1-t(2)*s2-t(3)*s3)/s1;
                s=t*VTV;
                s=s/s(1);
                data.FixPoint2_SV(1:2)=s(2:3);
                
            else
                pt = get(AxesAFS, 'CurrentPoint');
                data.FixPoint2_SV = pt(1,1:2);
                
                [h,n]=size(data.Vraw);
                e=ones(h,1);
                t1=[1,data.FixPoint2_SV(1),data.FixPoint2_SV(2)];
                
                h=t1*data.Vraw(:,1:3)';
                s=h*e;
                V1=data.V_scal;
                t2=h*V1/s;
                data.FixPoint2_B(1:2)=t2(2:3);
        end
        actpwd = pwd;
        

        cd(actpwd);
        set(Empty_Button,'UserData',data);
        plotAFS_BKP(Empty_Button,AxesAFS);
        
        if data.scalBorg==1
            hold(AxesAFS, 'on');
            plot(AxesAFS,data.FixPoint1_B(1),data.FixPoint1_B(2),'kx','Linewidth',2);
            plot(AxesAFS,data.FixPoint2_B(1),data.FixPoint2_B(2),'ko','Linewidth',2);
            for i=1:2
                if data.numb_segmentsL(i) > 0
                    if i==1
                        plot(AxesAFS,data.AFSL_B{i}([1:end 1],1),data.AFSL_B{i}([1:end 1],2),'k--','Linewidth',2);
                    else
                        plot(AxesAFS,data.AFSL_B{i}([1:end 1],1),data.AFSL_B{i}([1:end 1],2),'k--','Linewidth',2);
                    end
                end
            end
            
            hold(AxesAFS, 'off');
        else
            hold(AxesAFS, 'on');
            plot(AxesAFS,data.FixPoint1_SV(1),data.FixPoint1_SV(2),'kx','Linewidth',2);
            plot(AxesAFS,data.FixPoint2_SV(1),data.FixPoint2_SV(2),'ko','Linewidth',2);
            for i=1:2
                if data.numb_segmentsL(i) > 0
                    if i==1
                        plot(AxesAFS,data.AFSL_SV{i}([1:end 1],1),data.AFSL_SV{i}([1:end 1],2),'k--','Linewidth',2);
                    else
                        plot(AxesAFS,data.AFSL_SV{i}([1:end 1],1),data.AFSL_SV{i}([1:end 1],2),'k--','Linewidth',2);
                    end
                end
            end
            
            hold(AxesAFS, 'off');
        end
        
        set(usmn, 'Value', 0);
        set(usmf, 'Value', 1);
        
        
    else
         if data.scalBorg==1
                pt = get(AxesAFS, 'CurrentPoint');
                data.FixPoint3_B = pt(1,1:2);
                
                V1=data.V_scal;
                VTV = V1'*data.Vraw;
                s1=data.sum_v1;
                s2=data.sum_v2;
                s3=data.sum_v3;
                
                t(2:3)=data.FixPoint3_B;
                t(1)=(1-t(2)*s2-t(3)*s3)/s1;
                s=t*VTV;
                s=s/s(1);
                data.FixPoint3_SV(1:2)=s(2:3);
                
            else
                pt = get(AxesAFS, 'CurrentPoint');
                data.FixPoint3_SV = pt(1,1:2);
                
                [h,n]=size(data.Vraw);
                e=ones(h,1);
                t1=[1,data.FixPoint3_SV(1),data.FixPoint3_SV(2)];
                
                h=t1*data.Vraw(:,1:3)';
                s=h*e;
                V1=data.V_scal;
                t2=h*V1/s;
                data.FixPoint3_B(1:2)=t2(2:3);
        end
        set(Empty_Button,'UserData',data);
        plotAFS_BKP(Empty_Button,AxesAFS);
        
        if data.scalBorg==1
            hold(AxesAFS, 'on');
            plot(AxesAFS,data.FixPoint1_B(1),data.FixPoint1_B(2),'kx','Linewidth',2);
            plot(AxesAFS,data.FixPoint2_B(1),data.FixPoint2_B(2),'ko','Linewidth',2);
            plot(AxesAFS,data.FixPoint3_B(1),data.FixPoint3_B(2),'k+','Linewidth',2);
            for i=1:2
                if data.numb_segmentsL(i) > 0
                    if i==1
                        plot(AxesAFS,data.AFSL_B{i}([1:end 1],1),data.AFSL_B{i}([1:end 1],2),'k--','Linewidth',2);
                    else
                        plot(AxesAFS,data.AFSL_B{i}([1:end 1],1),data.AFSL_B{i}([1:end 1],2),'k--','Linewidth',2);
                    end
                end
            end
            if data.numb_segmentsL2 > 0
                plot(AxesAFS,data.AFSL2_B([1:end 1],1),data.AFSL2_B([1:end 1],2),'k-.','Linewidth',2);
            end
            
            hold(AxesAFS, 'off');
        else
            hold(AxesAFS, 'on');
            plot(AxesAFS,data.FixPoint1_SV(1),data.FixPoint1_SV(2),'kx','Linewidth',2);
            plot(AxesAFS,data.FixPoint2_SV(1),data.FixPoint2_SV(2),'ko','Linewidth',2);
            plot(AxesAFS,data.FixPoint3_SV(1),data.FixPoint3_SV(2),'k+','Linewidth',2);
            for i=1:2
                if data.numb_segmentsL(i) > 0
                    if i==1
                        plot(AxesAFS,data.AFSL_SV{i}([1:end 1],1),data.AFSL_SV{i}([1:end 1],2),'k--','Linewidth',2);
                    else
                        plot(AxesAFS,data.AFSL_SV{i}([1:end 1],1),data.AFSL_SV{i}([1:end 1],2),'k--','Linewidth',2);
                    end
                end
            end
            if data.numb_segmentsL2 > 0
                plot(AxesAFS,data.AFSL2_SV([1:end 1],1),data.AFSL2_SV([1:end 1],2),'k-.','Linewidth',2);
            end
            
            hold(AxesAFS, 'off');
        end
        set(usmn, 'Value', 0);
        set(usmf, 'Value', 1);
        
    end
end
set(Empty_Button,'UserData',data);