function printit( input )
global COLOUR
global ORIENT
orient portrait
if ORIENT==1 orient landscape; end
ostype='windows';
if isunix==1 ostype='linux__'; end
disp(strcat('Detected_',ostype,' OS'));
if ostype=='windows'
filetype='.jpeg';
else
filetype='.eps ';
if COLOUR==1 filetype='.epsc'; end
end
figure(input)
autoname=1;
if autoname==0
fn=strcat('temp',filetype);
else
temp=date; temp2=clock;
hour=num2str(temp2(4),'%02i'); min=num2str(temp2(5),'%02i'); sec=num2str(fix(temp2(6)),'%02i');
fn=strcat('auto_',date,'_',hour,min,sec,filetype)
end
if filetype=='.jpeg'
print( '-djpeg', '-r300', fn );
end
if filetype=='.eps '
print( '-painters','-deps2', '-r300', fn );
end
if filetype=='.epsc'
print( '-painters','-depsc2', '-r300', fn );
end
if ostype=='windows'
return;
end
if filetype=='.jpeg'
system(['xv ',fn,' &']);
end
if (filetype =='.epsc' | filetype == '.eps ')
disp('hi')
system(['/usr/bin/gv ',fn,' &']);
end