function extractaxesRAY(hObject, eventdata, parentfig, Empty_Button, Buttons, AxesD, AxesNMF, AxesAFS, AxesSOL, TabGroup, lcs, 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);
    
    posNMF = get(AxesNMF, 'Position');
    posAFS = get(AxesAFS, 'Position');
    posSOL = get(AxesSOL, 'Position');
    posD   = get(AxesD, '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 (posNMF(1) < x(1)) && (x(1) < posNMF(1)+posNMF(3)) && (posNMF(2) < x(2)) && (x(2) < posNMF(2)+posNMF(4))
        tmpc = figure;
        copyobj(AxesNMF,tmpc);
        tmpa = get(tmpc,'CurrentAxes');
        set(tmpa,'position',[0.15 0.15 0.75 0.75]);
        title(tmpa, 'NMF factor(s)');
        
    elseif (posAFS(1) < x(1)) && (x(1) < posAFS(1)+posAFS(3)) && (posAFS(2) < x(2)) && (x(2) < posAFS(2)+posAFS(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,'\alpha','interpreter','tex');
        ylabel(tmpa,'\beta','interpreter','tex');
        zlabel(tmpa,'\gamma','interpreter','tex');
        
    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');
        
    end
end
set(Empty_Button,'UserData',data);
