function plotmulti(X, Y,leglab, fignum);



[a,b]=size(X);


if a == 1 | b == 1
    if a > b; %make sure the time is in rows
        X=X';
        [a,b]=size(X);
    end
    for n=1:1:length(Y(:,1))
        X(n,:)=X(1,:);     %makes the X row vector repeat if it is only entered once
    end
end
    

%plots multiple rows of data in a nice format
figure(fignum); clf;

sty=['  r';'  b';'  g';'  k'; '  c'; '  m'; 'r--'; 'b--'; 'g--'; 'k--'; 'c--';'m--';'r- '; 'b- '; 'g- '; 'k- '; 'c- ';'m- ';'r: '; 'b: '; 'g: '; 'k: '; 'c: ';'m: ';'  r';'  b';'  g';'  k'; '  c'; '  m'];

for n=1:1:length(X(:,1))
    n
    hold on;
    plot(X(n,:), Y(n,:), char(sty(n,1:3)))
end

legend(leglab)  %sty(1:length(X(:,1)), 1:3),