function [errVec,Ind]=show_err_syn(prefix, nfields, img_incr, postfix,entroy_factor)
 fname=[sprintf('%sErr.dat',prefix)];
 [errVec, len, Ind]=read_dat_nfields(fname,nfields);
 clf;
 subplot(4,1,1);
 plot(Ind, errVec(:,2));hold on; plot(Ind,errVec(:,3),'r--');
 p=title([sprintf('Syn (-) and target energy (r--) from %s', fname)]);
 set(p,'Interpreter','none');
 set(p,'FontSize',[8]);    
 set(get(p,'Parent'),'FontSize',[8]);
 grid on;
 subplot(4,1,2);
 plot(Ind,errVec(:,nfields));
 if nfields > 4 & entropy_factor > 0.0,
  hold on; 
  plot(Ind,errVec(:,4)*entroy_factor,'r--');
  p=title([sprintf('Err and entropy (x%6.2f) from %s', entroy_factor,fname)]);
 else
  p=title([sprintf('Err from %s', fname)]);
 end
 set(p,'Interpreter','none');
 set(p,'FontSize',[8]);    
 set(get(p,'Parent'),'FontSize',[8]);
 grid on;

 subplot(4,1,3);
 plot(Ind,errVec(:,2)-errVec(:,3));
 p=title([sprintf('Energy difference from %s', fname)]);
 set(p,'Interpreter','none');
 set(p,'FontSize',[8]);    
 set(get(p,'Parent'),'FontSize',[8]);
 grid on;

 XLim=get(get(p,'Parent'),'XLim');
 nitem = floor((len-1)*10/img_incr)*img_incr;
 fname=sprintf('%s%s0.pgm',prefix,postfix);
 im=readp5(fname);
 clear err;
 for i=img_incr:img_incr:nitem,
 fname=sprintf('%s%s%d.pgm',prefix,postfix,i);
 im1=readp5(fname);
 err(i/img_incr)=sqrt(sum(sum((im1-im).^2))/(size(im1,1)*size(im1,2)));
 im=im1;
 end;
 if nitem >= img_incr,
  subplot(4,1,4);
  plot(img_incr:img_incr:nitem,err);
  p=title([sprintf('Variance from %s', fname)]);
  set(p,'Interpreter','none');
  set(p,'FontSize',[8]);    
  set(get(p,'Parent'),'FontSize',[8]);
  YLim=get(get(p,'Parent'),'YLim');YLim(1)=0;set(get(p,'Parent'),'YLim',YLim);
  set(get(p,'Parent'),'XLim',XLim);
 end;
 grid on;
 zoom on;
return;
