function liveview(hObject, eventdata, Empty_Button, Button, Helpfield, AxesD, AxesNMF, AxesAFS, AxesSOL, Radiogroup, usmn, lcs, basichi)
Help = get(Helpfield(1),'Value');
if Help == 1
    pt = get(hObject, 'CurrentPoint');
    sz = get(hObject, 'Position');
    x = pt(1,1:2)./sz(1,3:4);
    
    posF(1,:) = get(AxesD, 'Position');
    posF(2,:) = get(AxesNMF, 'Position');
    posF(3,:) = get(AxesAFS, 'Position');
    posF(4,:) = get(AxesSOL, 'Position');
    
    for i=1:length(Button)
        posB(i,:) = get(Button(i), 'Position');
    end
    
    for i=1:length(Radiogroup)
        posR(i,:) = get(Radiogroup(i), 'Position');
    end
    
    viewhelp(Helpfield, posB, posF, posR, x);
end

if get(usmn, 'Value') == 0
    return;
end
data = get(Empty_Button,'UserData');
plot(AxesSOL,data.x([1 end]),[0 0],'w');
pt = get(AxesAFS, 'CurrentPoint');
x = pt(1,1:2);

pt = get(hObject, 'CurrentPoint');
sz = get(hObject, 'Position');
xf = pt(1,1:2)./sz(1,3:4);
posAFS = get(AxesAFS, 'Position');

if (posAFS(1) < xf(1)) && (xf(1) < posAFS(1)+posAFS(3)) && (posAFS(2) < xf(2)) && (xf(2) < posAFS(2)+posAFS(4))
    if data.s == 2
        if (data.mima(1,1) < x(1)) && (data.mima(1,2) > x(1)) && (data.mima(2,1) < x(2)) && (data.mima(2,2) > x(2))
            lw = 2;
        else
            lw = 0.5;
        end

        T = [1 x(1);1 x(2)];
        a = T*data.V(:,1:2)';
        c = data.U*data.S(:,1:2)*pinv(T);
        c(:,1) = c(:,1)/data.mima(2,6)*data.mima(1,4);
        c(:,2) = c(:,2)/data.mima(1,6)*data.mima(2,4);

        data.isLastClickLockMode = 1;
        data.LastClickLockMode.FixPoint = x;
        data.LastClickLockMode.a = a;
        data.LastClickLockMode.c = c;

        plot(AxesSOL,data.x,a(1,:),'color',lcs(1,:),'Linewidth',lw);
        hold(AxesSOL,'on');
        plot(AxesSOL,data.x,a(2,:),'color',lcs(2,:),'Linewidth',lw);

        plot(AxesSOL,linspace(data.x(1),data.x(end),size(data.t,1)),c(:,1),'-.','color',lcs(1,:),'Linewidth',lw);
        plot(AxesSOL,linspace(data.x(1),data.x(end),size(data.t,1)),c(:,2),'-.','color',lcs(2,:),'Linewidth',lw);

        hold(AxesSOL,'off');

        xlabel(AxesSOL,'channel / time');

        xli = [min(data.x), max(data.x)];
        yli = 1.1*[min([0, data.mima(1,3), data.mima(2,3)]), max(data.mima(1,4), data.mima(2,4))];

        posX = xli(1)+0.65*(xli(2)-xli(1));
        posY = yli(1)+0.9*(yli(2)-yli(1));
        text(posX,posY,['(x,y) = (',num2str(x(1),'%4.4f'),', ',num2str(x(2),'%4.4f'),')'],...
            'fontsize',2*basichi,'FontWeight','bold','Parent',AxesSOL);

        set(AxesSOL,'ylim',yli,'xlim',xli,'YTick',[0]);
    elseif data.s == 3

        ExpMode = 1;
        hold(AxesSOL,'off');
        if (isfield(data,'isExpert1') == 1) && (data.isExpert1 == 1)
            ExpMode = 2;

            if (isfield(data,'isExpert2') == 1) && (data.isExpert2 == 1)
                ExpMode = 3;
            end
        end 

        if data.isafs == 1
            data.isLastClickLockMode = 1;
            data.LastClickLockMode.FixPoint = x;
            data.LastClickLockMode.a = [1 x]*data.V(:,1:3)';

            if data.parts >= 3
                inn = 0;
                for i=1:data.parts
                    if data.valid(i) == 1
                        if (data.mima(i,1) < x(1)) && (data.mima(i,2) > x(1)) && (data.mima(i,3) < x(2)) && (data.mima(i,4) > x(2))
                            if inpolygon(x(1), x(2), data.AFS{i}(:,1), data.AFS{i}(:,2))
                                if i<=6
                                    plot(AxesSOL,data.x,[1 x]*data.V(:,1:3)','color',lcs(i,:),'Linewidth',2);
                                    data.colorExpert(ExpMode,:) = lcs(i,:);
                                else
                                    plot(AxesSOL,data.x,[1 x]*data.V(:,1:3)','color',[0 0 0],'Linewidth',2);
                                    data.colorExpert(ExpMode,:) = [0 0 0];
                                end

                                xli = [min(data.x), max(data.x)];
                                yli = 1.1*[min(0, data.mima(i,5)), data.mima(i,6)];

                                posX = xli(1)+0.65*(xli(2)-xli(1));
                                posY = yli(1)+0.9*(yli(2)-yli(1));
                                text(posX,posY,['(x,y) = (',num2str(x(1),'%4.4f'),', ',num2str(x(2),'%4.4f'),')'],'fontsize',20*basichi,'FontWeight','bold','Parent',AxesSOL);

                                set(AxesSOL,'ylim',yli,'xlim',xli);
                                xlabel(AxesSOL,'channel');
                                inn = 1;
                            end
                        end
                        if inn == 1
                            break;
                        end
                    end

                    if inn == 0
                        plot(AxesSOL,data.x,[1 x]*data.V(:,1:3)','--k','Linewidth',1);
                        xli = [min(data.x), max(data.x)];
                        yli = 1.1*[min(0, min(data.mima(:,5))), max(data.mima(:,6))];

                        posX = xli(1)+0.65*(xli(2)-xli(1));
                        posY = yli(1)+0.9*(yli(2)-yli(1));
                        text(posX,posY,['(x,y) = (',num2str(x(1),'%4.4f'),', ',num2str(x(2),'%4.4f'),')'],...
                            'fontsize',2*basichi,'FontWeight','bold','Parent',AxesSOL);

                        set(AxesSOL,'ylim',yli,'xlim',xli);
                        xlabel(AxesSOL,'channel');
                    end
                end
            elseif data.parts == 1
                inn(1:2) = 0;
                for i=1:2
                    if data.valid(i) == 1
                        if (data.mima(i,1) < x(1)) && (data.mima(i,2) > x(1)) && (data.mima(i,3) < x(2)) && (data.mima(i,4) > x(2))
                            if inpolygon(x(1), x(2), data.AFS{i}(:,1), data.AFS{i}(:,2))
                                inn(i) = 1;
                            end
                        end
                    end
                end
                if inn(1)*(1-inn(2)) == 1
                    plot(AxesSOL,data.x,[1 x]*data.V(:,1:3)'/max([1 x]*data.V(:,1:3)')*data.mima(1,6),'k','Linewidth',2);
                    data.colorExpert(ExpMode,:) = [0 0 0];

                    xli = [min(data.x), max(data.x)];
                    yli = 1.1*[min(0, data.mima(1,5)), data.mima(1,6)];

                    posX = xli(1)+0.65*(xli(2)-xli(1));
                    posY = yli(1)+0.9*(yli(2)-yli(1));

                    text(posX,posY,['(x,y) = (',num2str(x(1),'%4.4f'),', ',num2str(x(2),'%4.4f'),')'],...
                        'fontsize',2*basichi,'FontWeight','bold','Parent',AxesSOL);

                    set(AxesSOL,'ylim',yli,'xlim',xli);
                    xlabel(AxesSOL,'channel');
                else
                    plot(AxesSOL,data.x,[1 x]*data.V(:,1:3)','--k','Linewidth',1);
                    xli = [min(data.x), max(data.x)];
                    yli = 1.1*[min(0, min(data.mima(:,5))), max(data.mima(:,6))];

                    posX = xli(1)+0.65*(xli(2)-xli(1));
                    posY = yli(1)+0.9*(yli(2)-yli(1));
                    text(posX,posY,['(x,y) = (',num2str(x(1),'%4.4f'),', ',num2str(x(2),'%4.4f'),')'],...
                        'fontsize',2*basichi,'FontWeight','bold','Parent',AxesSOL);

                    set(AxesSOL,'ylim',yli,'xlim',xli);
                    xlabel(AxesSOL,'channel');

                end
            end
        end
        
        if (isfield(data,'isimport') == 1) && (data.isimport == 1)
            hold(AxesSOL,'on');
            if data.import.adaptedis == 0
                for i=1:data.import.s
                    plot(AxesSOL, data.x, data.import.A(i,:),'c','Linewidth',1)
                end
            else
                for i=1:data.import.s
                    plot(AxesSOL, data.x(data.import.adaptedI(1):data.import.adaptedI(2)), data.import.A(i,:),'c','Linewidth',1)
                end
            end
            hold(AxesSOL,'off');
        end

        if (isfield(data,'isExpert1') == 1) && (data.isExpert1 == 1)
            hold(AxesSOL,'on');
            plot(AxesSOL,data.x,[1 data.FixPoint1]*data.V(:,1:3)','color',data.colorExpert(1,:),'Linewidth',2);

            if (isfield(data,'isExpert2') == 1) && (data.isExpert2 == 1)
                hold(AxesSOL,'on');
                plot(AxesSOL,data.x,[1 data.FixPoint2]*data.V(:,1:3)','color',data.colorExpert(2,:),'Linewidth',2);
            end
        end
    end
    hold(AxesSOL,'off');
    set(Empty_Button,'UserData',data);
end
