function [X Y out work] = plotSexpSsimAllFun(sigmaData, out, work, user, conditions)

X = [];
Y = [];

methylAtomsIncPseudo    = conditions.all.methylAtomsAndPseudo;

    for j=1:length(sigmaData)
        
% % %         if isfield(indices.sigmaData, 'spinDiff')
            
            if ~isempty(sigmaData(j).spinDiff)
                
                plotData(j).sigmaSim    = sigmaData(j).spinDiff.PROCsigmaDir;
                plotData(j).avgSigma    = sigmaData(j).avgSigma;
                plotData(j).sigmaCorr   = sigmaData(j).sigmaCorrij;
                
            else
                
                plotData(j).sigmaSim    = [];
                plotData(j).avgSigma    = [];
                plotData(j).sigmaCorr   = [];
                
            end
% % %         end
    end

if user.plotIsoAnisosExp == 1
    
    subplot(1,1,1); hold; xlabel('sIsoExp'); ylabel('sIsoSim');
    w =  sprintf('sIsoExp vs. sIsoSim ALL VALUES');
    title(w);
    
end

if user.plotIsoAnisosExp == 2
    
    subplot(1,1,1); hold; xlabel('sAnisoExp'); ylabel('sAnisoSim');
    w =  sprintf('sAnisoExp vs. sAnisoSim ALL VALUES');
    title(w);
    
end

  for j=1:length(sigmaData)
      
      bothAtoms = [sigmaData(j).numcode.ATOMi, sigmaData(j).numcode.ATOMj];

      if  ~isempty(plotData(j).sigmaSim)  
          
          if sigmaData(j).unique == 2     %The first one of the partners
              
              out.plottedPoints = out.plottedPoints + 1;
                        
                      if size(find(ismember(bothAtoms, conditions.all.nGrpMethyleneNoNH)), 2) == 2
                
                            X(j) = plotData(j).avgSigma;
                            Y(j) = plotData(j).sigmaSim;
                            
                            if strcmp(user.jindx, 'n') == 1   
                                plot(X(j),Y(j),'ko','MarkerSize',5);
                            elseif strcmp(user.jindx, 'y') == 1
                                text(X(j),Y(j),num2str(j),'color','k','FontSize',8,'HorizontalAlignment','center'); % all methylene noGrp except NH black
                            end
                      end
              
                        
                      if size(find(ismember(bothAtoms, 1)), 2) == 2
                          
                            X(j) = plotData(j).avgSigma;
                            Y(j) = plotData(j).sigmaSim;
                
                            if strcmp(user.jindx, 'n') == 1   
                                plot(X(j),Y(j),'ro','MarkerSize',5);
                            elseif strcmp(user.jindx, 'y') == 1
                                text(X(j),Y(j),num2str(j),'color','r','FontSize',8,'HorizontalAlignment','center'); % NH-NH red
                            end
                      end
                      
                      
                      if  size(find(ismember(bothAtoms, 1)), 2) == 1 && size(find(ismember(bothAtoms, methylAtomsIncPseudo)), 2) == 1
                
                            X(j) = plotData(j).avgSigma;
                            Y(j) = plotData(j).sigmaSim;
                            
                            if strcmp(user.jindx, 'n') == 1   
                                plot(X(j),Y(j),'bs','MarkerSize',6);
                            elseif strcmp(user.jindx, 'y') == 1
                                text(X(j),Y(j),num2str(j),'color','b','FontSize',8,'HorizontalAlignment','center'); % one methyl Pseudo blue
                            end
                      end
                      
                      
                      if size(find(ismember(bothAtoms, methylAtomsIncPseudo)), 2) == 2
                            
                            X(j) = plotData(j).avgSigma;
                            Y(j) = plotData(j).sigmaSim;
                          
                            if strcmp(user.jindx, 'n') == 1   
                                plot(X(j),Y(j),'gp','MarkerSize',7);
                            elseif strcmp(user.jindx, 'y') == 1
                                text(X(j),Y(j),num2str(j),'color','g','FontSize',8,'HorizontalAlignment','center'); % two methyl Pseudo green
                            end
                      end
          end
          
         
          if user.plotUnique == 'n'
              
              if sigmaData(j).unique == 1     %NO partner
            
              out.plottedPoints = out.plottedPoints + 1;
              
                      if size(find(ismember(bothAtoms, conditions.all.nGrpMethyleneNoNH)), 2) == 2
                
                            X(j) = plotData(j).sigmaCorr;
                            Y(j) = plotData(j).sigmaSim;
                          
                            if strcmp(user.jindx, 'n') == 1   
                                plot(X(j),Y(j),'k+','MarkerSize',5);
                            elseif strcmp(user.jindx, 'y') == 1
                                text(X(j),Y(j),num2str(j),'color','k','FontSize',8,'HorizontalAlignment','center'); % all methylene noGrp except NH black
                            end
                      end
              
                      if size(find(ismember(bothAtoms, 1)), 2) == 2
                          
                            X(j) = plotData(j).sigmaCorr;
                            Y(j) = plotData(j).sigmaSim;
                          
                            if strcmp(user.jindx, 'n') == 1   
                                plot(X(j),Y(j),'r+','MarkerSize',6);
                            elseif strcmp(user.jindx, 'y') == 1
                                text(X(j),Y(j),num2str(j),'color','r','FontSize',8,'HorizontalAlignment','center'); % NH-NH red
                            end
                      end
                      
                      if size(find(ismember(bothAtoms, 1)), 2) == 1 && size(find(ismember(bothAtoms, methylAtomsIncPseudo)), 2) == 1

                            X(j) = plotData(j).sigmaCorr;
                            Y(j) = plotData(j).sigmaSim;  
                          
                            if strcmp(user.jindx, 'n') == 1   
                                plot(X(j),Y(j),'b+','MarkerSize',6);
                            elseif strcmp(user.jindx, 'y') == 1
                                text(X(j),Y(j),num2str(j),'color','b','FontSize',8,'HorizontalAlignment','center'); % one methyl Pseudo blue
                            end
                      end
                      
                      
                      if size(find(ismember(bothAtoms, methylAtomsIncPseudo)), 2) == 2

                            X(j) = plotData(j).sigmaCorr;
                            Y(j) = plotData(j).sigmaSim;
                          
                            if strcmp(user.jindx, 'n') == 1   
                                plot(X(j),Y(j),'g+','MarkerSize',6);
                
                            elseif strcmp(user.jindx, 'y') == 1
                                text(X(j),Y(j),num2str(j),'color','g','FontSize',8,'HorizontalAlignment','center'); % two methyl Pseudo green
                            end
                      end    
              end
          end
      end
  end
  
  out.slopeSexpSsim = Y/X;
  
  if min(X) < min(Y)
    minvalue = min(X);
  else
    minvalue = min(Y);
  end
  
  if max(X) > max(Y)
    maxvalue = max(X);
  else
    maxvalue = max(Y);
  end
 
  axis([minvalue maxvalue  minvalue  maxvalue])
  
  hline = refline(1,0);
  set(hline,'Color','k','LineWidth',0.5)
  
end