q=read_motionFile('controls_cmc.sto');

clf;
close all;

scrsz = get(0,'ScreenSize');

T=q.data(:,1);
I=1:length(T);
I=find(T>=0.6001 & T<=1.8404);

% left
ticks(1).values=[0.8 1.23 2 2.45];
ticks(1).labels={'TO','HS','TO','HS'};

% right
ticks(2).values=[0.6002 1.42 1.8403 2.64];
ticks(2).labels={'HS','TO','HS','TO'};

LR={'l','r'};
pos=[20 20 1024 768];

side=2;

labels={'lat_gas'};
names={'GAS lat'};

for i=1:length(labels)
	figure('Position',pos);
	set(gcf,'PaperPosition',[0 0 8 4]);
	axes('FontSize',20);
	plot_excitations(q,labels{i},names{i},ticks,I,msl,side);
	print('-dpng','-r300',sprintf('excitation_%s_%s',strrep(names{i},' ','_'),LR{side}));
end


%% Abductors (contribute to pelvic list)
%figure('Position',pos, 'Color',[1 1 1]);
%axes('FontSize',20);
%for side=1:2
%	subplot(2,2,side);
%	plot_muscle(q,'glut_med','GMED',ticks,I,msl,side);
%	subplot(2,2,2+side);
%	plot_muscle(q,'glut_min','GMIN',ticks,I,msl,side);
%end
%
%figure('Position',pos, 'Color',[1 1 1]);
%axes('FontSize',20);
%for side=1:2
%	% Plantar flexors
%	subplot(3,2,side);
%	plot_muscle(q,'soleus','SOL',ticks,I,msl,side);
%	subplot(3,2,2+side);
%	plot_muscle(q,{'med_gas','lat_gas'},'GAS med,lat',ticks,I,msl,side);
%
%	% Dorsi flexors
%	subplot(3,2,4+side);
%	plot_muscle(q,'tib_ant','TA',ticks,I,msl,side);
%end
%
%% Biarticular
%figure('Position',pos, 'Color',[1 1 1]);
%axes('FontSize',20);
%for side=1:2
%	subplot(4,2,side);
%	plot_muscle(q,'rect_fem','RF',ticks,I,msl,side);
%
%	% Hamstrings
%	subplot(4,2,2+side);
%	plot_muscle(q,{'semimem','semiten'},'SM',ticks,I,msl,side);
%	subplot(4,2,4+side);
%	plot_muscle(q,'bifemlh','BFLH',ticks,I,msl,side);
%	subplot(4,2,6+side);
%	plot_muscle(q,'bifemsh','BLSH',ticks,I,msl,side);
%end
%
%figure('Position',pos, 'Color',[1 1 1]);
%axes('FontSize',20);
%for side=1:2
%	% Uniarticular extensors
%	subplot(3,2,side);
%	plot_muscle(q,'glut_max','GMAX',ticks,I,msl,side);
%	subplot(3,2,2+side);
%	plot_muscle(q,{'vas_med','vas_int','vas_lat'},'VAS med,int,lat',ticks,I,msl,side);
%
%	% Uniarticular flexors
%	subplot(3,2,4+side);
%	plot_muscle(q,{'iliacus','psoas'},'IL,PS',ticks,I,msl,side);
%end
