function   x = sviplot2(input);
% SVIPLOT2
%     [XX] = SVIPLOT2(INPUT)
%     This function is only used by SVITERBI.C
%
%     See also SVIPLOT1, SVIPLOT3.

%  Copyright 1996-2000 The MathWorks, Inc.
%       $Revision: 1.10 $

fig_position = input(1);
leng = input(2);
plot_flag = input(3);
n_std_sta = input(4);
x(1) = input(5);

handles = get(x(1), 'UserData');

set(handles(1), 'XLim', [fig_position-leng, fig_position + plot_flag - leng]);
plot_curv_x = get(handles(2), 'XData');
plot_curv_y = get(handles(2), 'YData');
index = find(plot_curv_x == -(fig_position - leng));
leng_x = length(plot_curv_x);
if isempty(index)
    % no move
else
    plot_curv_x = plot_curv_x(index(1)+2: leng_x);
    plot_curv_y = plot_curv_y(index(1)+2: leng_x);
end;
set(handles(2), 'XData', plot_curv_x, 'YData', plot_curv_y);
for i = 0:n_std_sta - 1
    tmp = get(handles(5+n_std_sta+i), 'Position');
    tmp(1) = fig_position-leng-plot_flag/8;
    set(handles(5+n_std_sta+i), 'Position', tmp);
end;
tmp = get(handles(5+2*n_std_sta), 'Position');
tmp(1) = fig_position-leng+plot_flag/2.1;
set(handles(5+2*n_std_sta), 'Position', tmp);
plot_curv_x = get(handles(4), 'XData');
plot_curv_y = get(handles(4), 'YData');
index = find(plot_curv_x <= fig_position-leng);
index = max([index(length(index)) 0]) + 1;
leng_x = length(plot_curv_x);
plot_curv_x = plot_curv_x(index : leng_x);
plot_curv_y = plot_curv_y(index : leng_x);
set(handles(4), 'XData', plot_curv_x, 'YData', plot_curv_y);

%end of sviplot2.m








