function varargout = Plot_Gauss_Fit(x,y,profx,profy,gau_x,gau_y,gaux_sigma,gauy_sigma,xunit,yunit,gaux_center,gauy_center,thisfilename) % plot gaussian fits % December 2010. Written by Sadiq Setiniyaz figure(2) subplot(2,1,1) hd = plot(x,profx); hold on hg = plot(x,gauss(gau_x,x),'r'); % some nicer look ht=title([' - horizontal profile: sigma(x) = ',num2str(gaux_sigma,'%7.9f'),' ',xunit,' center(x) = ',num2str(gaux_center,'%7.9f'),' ',xunit]); legend(gca,'horizontal profile','Gauss Fit') set(hd,'LineWidth',2) set(hg,'LineWidth',1) hx = xlabel('Pixels'); hy = ylabel('Bin Content (# of Electrons)'); set(gca,'FontSize',12) set(hx,'FontSize',12) set(hy,'FontSize',12) set(ht,'FontSize',12,'FontWeight','bold'); drawnow % print to eps file printfilename = [thisfilename(1:max(findstr(thisfilename,'.')-1)),'_x.eps']; disp([' Print plot on file = ',printfilename]) print('-depsc','-r600',printfilename) % y subplot(2,1,2) hd = plot(y,profy); hold on hg = plot(y,gauss(gau_y,y),'r'); % some nicer look ht = title([' - vertical profile: sigma(y) = ',num2str(gauy_sigma,'%7.9f'),' ',yunit,' center(y) = ',num2str(gauy_center,'%7.9f'),' ',yunit]); legend(gca,'vertical profile','Gauss Fit') set(hd,'LineWidth',2) set(hg,'LineWidth',1) hx = xlabel('Pixels'); hy = ylabel('Bin Content (# of Electrons)'); set(gca,'FontSize',12) set(hx,'FontSize',12) set(hy,'FontSize',12) set(ht,'FontSize',12,'FontWeight','bold'); drawnow % print to eps file printfilename = [thisfilename(1:max(findstr(thisfilename,'.')-1)),'_y.eps']; disp([' Print plot on file = ',printfilename]) print('-depsc','-r600',printfilename)