function plotmulticom2(X, Y1, Y2,leglab, fignum);
% X=comptime;
% Y=squeeze(compT(:,le,:));
% leglab=['45';'46';'47';'48';'49'];
% fignum=3;
[a,b]=size(X);
if a == 1 | b == 1
    for n=1:1:length(Y1(:,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'];

subplot(3,1,1)
for n=1:1:length(X(:,1))
    hold on;
    plot(X(n,:), Y1(n,:), char(sty(n,1:3)), 'LineWidth', 2.5)
end

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

subplot(3,1,2)
for n=1:1:length(X(:,1))
    hold on;
    plot(X(n,:), Y2(n,:), char(sty(n,1:3)), 'LineWidth',2.5)
end

subplot(3,1,3)
for n=1:1:length(X(:,1))
    hold on;
    plot(X(n,:), Y1(n,:)-Y2(n,:), char(sty(n,1:3)), 'LineWidth', 2.5)
end
