function plot_muscle(q,labels,name,ticks,I,msl,side)

if isa(labels, 'char')
	labels = { labels };
end


T=q.data(:,1);
LR={'l','r'};

d=zeros(length(I),length(labels));
mm=0;

for i=1:length(labels)
	index=find_columns_by_label(q.labels,[labels{i} '.*' LR{side}]);
	dd=sum(q.data(I,index),2);
	mslindex=find_columns_by_label(msl.names,[labels{i} '.*' LR{side}]);
	mm=max(mm,sum(msl.max_force(mslindex)));
	d(:,i) = sum(q.data(I,index),2);
end

%for i=1:length(labels)
%	for s=1:2
%		index=find_columns_by_label(q.labels,[labels{i} '.*' LR{s}]);
%		dd=sum(q.data(I,index),2);
%		mm=max(mm,max(max(dd)));
%		if s==side
%			d(:,i) = sum(q.data(I,index),2);
%		end
%	end
%end

plot(T(I),d,'LineWidth',2);
if length(labels)>1
	legend(labels,'Interpreter','none');
end

set(gca,'XTick',ticks(side).values, 'XTickLabel', ticks(side).labels);
xlabel('% Gait cycle');
ylabel('Muscle force (N)');
axis([T(I(1)) T(I(end)) 0 mm]);
%title([name ' - ' upper(LR{side})],'FontSize',20);
title(name,'FontSize',20);
