function make_plots_new(speed1,path1,methods,close_first,save_it)

% Example Usage:

%make_plots_new({'walk125'},'JB011613',{'sang_mvc_lo';'low100_mvc_lo'},1,1);

% Makes plots including Perry EMG.

load ~/Documents/MATLAB/data/Perry_muscles/stim_act;

addpath '~/Dropbox/harvard/processMOT/';  

if close_first == 1
  close all;
end;

colors = ['k';'b';'r';'m';'g';'c';'y'];

cnt = 0;

for i = 1:size(speed1,1)
  for j = 1:size(path1,1)
    for k = 1:size(methods,1)
  
      cnt = cnt + 1;
      
      if ischar(speed1) == 0
        speedc  = char(speed1(i));
      else
        speedc  = speed1;
      end;
      if ischar(path1) == 0
        path1   = char(path1(j));
      else
        path1   = path1;
      end;
      if ischar(methods) == 0
        method1 = char(methods(k));
      else
        method1 = methods;
      end;
     
      infile1 = ['~/Documents/MATLAB/data/' path1 '/processed/EMG/avg_act_thresh'];
      infile1 = [infile1 '/' method1 '/' speedc '.mat']; 

      eval(['load ' infile1]);
      
      numpts = length(m_sTA);
      
      subplot(3,4,1)
      eval(['niceBars(0:(numpts-1),m_sTA,sd_sTA,''' colors(mod(cnt,7)+1) ''',0.5);']);
      hold on; grid on;
      %plot(0:(numpts-1),m_sTA,'k','linewidth',4);
      title('TA','fontsize',12);
      %xlabel('Percent Gait Cycle','fontsize',12);
      %ylabel('TA Activation Estimate','fontsize',12);
      subplot(3,4,2)
      eval(['niceBars(0:(numpts-1),m_sSOL,sd_sSOL,''' colors(mod(cnt,7)+1) ''',0.5);']);
      hold on; grid on;
      %plot(0:(numpts-1),m_sSOL,'k','linewidth',4);
      title('SOL','fontsize',12);
      %xlabel('Percent Gait Cycle','fontsize',12);
      %ylabel('SOL Activation Estimate','fontsize',12);
      subplot(3,4,3)
      eval(['niceBars(0:(numpts-1),m_sGAS,sd_sGAS,''' colors(mod(cnt,7)+1) ''',0.5);']);
      hold on; grid on;
      %plot(0:(numpts-1),m_sGAS,'k','linewidth',4);
      title('GAS','fontsize',12);
      %xlabel('Percent Gait Cycle','fontsize',12);
      %ylabel('GAS Activation Estimate','fontsize',12);
      subplot(3,4,4)
      eval(['niceBars(0:(numpts-1),m_sVAS,sd_sVAS,''' colors(mod(cnt,7)+1) ''',0.5);']);
      hold on; grid on;
      %plot(0:(numpts-1),m_sVAS,'k','linewidth',4);
      title('VAS','fontsize',12);
      %xlabel('Percent Gait Cycle','fontsize',12);
      %ylabel('VAS Activation Estimate','fontsize',12);
      subplot(3,4,5)
      eval(['niceBars(0:(numpts-1),m_sBFSH,sd_sBFSH,''' colors(mod(cnt,7)+1) ''',0.5);']);
      hold on; grid on;
      %plot(0:(numpts-1),m_sBFSH,'k','linewidth',4);
      title('BFSH','fontsize',12);
      %xlabel('Percent Gait Cycle','fontsize',12);
      %ylabel('BFSH Activation Estimate','fontsize',12);
      subplot(3,4,6)
      eval(['niceBars(0:(numpts-1),m_sRF,sd_sRF,''' colors(mod(cnt,7)+1) ''',0.5);']);
      hold on; grid on;
      %plot(0:(numpts-1),m_sRF,'k','linewidth',4); 
      title('RF','fontsize',12);
      %xlabel('Percent Gait Cycle','fontsize',12);
      %ylabel('RF Activation Estimate','fontsize',12);
      subplot(3,4,7)
      eval(['niceBars(0:(numpts-1),m_sHAM,sd_sHAM,''' colors(mod(cnt,7)+1) ''',0.5);']);              
      hold on; grid on;
      %plot(0:(numpts-1),m_sHAM,'k','linewidth',4);
      title('HAM','fontsize',12);
      %xlabel('Percent Gait Cycle','fontsize',12);
      %ylabel('HAM Activation Estimate','fontsize',12);
      subplot(3,4,8)
      eval(['niceBars(0:(numpts-1),m_sILL,sd_sILL,''' colors(mod(cnt,7)+1) ''',0.5);']);
      hold on; grid on;
      %plot(0:(numpts-1),m_sILL,'k','linewidth',4);
      title('ILL','fontsize',12);
      %xlabel('Percent Gait Cycle','fontsize',12);
      %ylabel('ILL Activation Estimate','fontsize',12);
      subplot(3,4,9)
      eval(['niceBars(0:(numpts-1),m_sGLU,sd_sGLU,''' colors(mod(cnt,7)+1) ''',0.5);']);
      hold on; grid on;
      %plot(0:(numpts-1),m_sGLU,'k','linewidth',4);
      title('GLU','fontsize',12);                
      %xlabel('Percent Gait Cycle','fontsize',12);
      %ylabel('GLU Activation Estimate','fontsize',12);
      subplot(3,4,10)
      eval(['niceBars(0:(numpts-1),m_sHAB,sd_sHAB,''' colors(mod(cnt,7)+1) ''',0.5);']);
      hold on; grid on;
      %plot(0:(numpts-1),m_sHAB,'k','linewidth',4);
      title('HAB','fontsize',12);                
      %xlabel('Percent Gait Cycle','fontsize',12);
      %ylabel('HAB Activation Estimate','fontsize',12);
      subplot(3,4,11)
      eval(['niceBars(0:(numpts-1),m_sADDL,sd_sADDL,''' colors(mod(cnt,7)+1) ''',0.5);']);
      hold on; grid on;
      %plot(0:(numpts-1),m_sADDL,'k','linewidth',4);
      title('ADDL','fontsize',12);                
      %xlabel('Percent Gait Cycle','fontsize',12);
      %ylabel('ADDL Activation Estimate','fontsize',12);
      subplot(3,4,12)
      eval(['niceBars(0:(numpts-1),m_sADDM,sd_sADDM,''' colors(mod(cnt,7)+1) ''',0.5);']);
      hold on; grid on;
      %plot(0:(numpts-1),m_sADDM,'k','linewidth',4);
      title('ADDM','fontsize',12);                
      %xlabel('Percent Gait Cycle','fontsize',12);
      %ylabel('ADDM Activation Estimate','fontsize',12);
    end;  
  end;    
end;

subplot(3,4,1)
plot(0:(numpts-1),p_sTA,'k','linewidth',3);
subplot(3,4,2)
plot(0:(numpts-1),p_sSOL,'k','linewidth',3);
subplot(3,4,3)
plot(0:(numpts-1),p_sGAS,'k','linewidth',3);
subplot(3,4,4)
plot(0:(numpts-1),p_sVLAT,'k','linewidth',3);
subplot(3,4,5)
plot(0:(numpts-1),p_sBFSH,'k','linewidth',3);
subplot(3,4,6)
plot(0:(numpts-1),p_sRF,'k','linewidth',3);
subplot(3,4,7)
plot(0:(numpts-1),p_sSMEM,'k','linewidth',3);
subplot(3,4,8)
plot(0:(numpts-1),p_sILL,'k','linewidth',3);
subplot(3,4,9)
plot(0:(numpts-1),p_sGLU_low,'k','linewidth',3);
subplot(3,4,10)
plot(0:(numpts-1),p_sGMED,'k','linewidth',3);
subplot(3,4,11)
plot(0:(numpts-1),p_sAL,'k','linewidth',3);
subplot(3,4,12)
plot(0:(numpts-1),p_sAM,'k','linewidth',3);
   
if exist('save_it')==1 && save_it==1;
  save_dir = ['~/Documents/MATLAB/data/' char(path1) '/processed/EMG/avg_act_thresh'];
  outfile = [char(path1) '_' char(speed1(1)) '_thresh'];
  eval(['print -dpng ' save_dir '/' outfile '.png;']);
end;
