x=1:100;
h = figure('visible','off');
i = figure('visible','off');
set(0,'CurrentFigure',h);
plot(x,x,'r-');hold on;
set(0,'CurrentFigure',i);
plot(x,x,'g-');hold on;
set(0,'CurrentFigure',h);
plot(x,2.*x,'g.');hold off;
set(0,'CurrentFigure',i);
plot(x,x.^2,'r.');hold off;
saveas(h, ['/home/..../ir_test/','test.eps'], 'psc2');
saveas(i, ['/home/..../ir_test/','test1.eps'], 'psc2');
close(h);
close(i);