disp('Running MATLAB script file foodfig2.m') ; % % Makes Figure 6 for the SiZerSS paper, % Uses Food Expenditure data, from EGsizer2ss.m % Smoothing SPline version of SiZer time0=clock; figure(1) ; %clf ; datpath=''; figpath=''; matpath=''; icolor=0; %% 1-color Sizer map, 0--black-white Sizer map dtitstr = 'Food Expenditures' ; infstr = 'nicfoo.dat' ; minfstr = 'nicfoo' ; frmtstr = '%g %g' ; insize = [2, inf] ; vicol = [1, 2] ; datatran = [] ; xstr = 'Net Income' ; ystr = 'Exp. for Food-Lfit' ; nspar=41; famolstr=['Family Overlay, nspar=',num2str(nspar)]; disp([' Loading ', dtitstr, ' Data']) ; eval(['load ',datpath,minfstr, ' ;']) ; if size(data,2) == 1 ; % then have only one column % so add dummy column for x's data = [(1:length(data))', data] ; end ; disp([' Read in ' num2str(size(data,1)) ' data points']) ; if length(datatran) ~= 0 ; % Then do some data transformation eval(datatran) ; end ; % Subtract fit line % lcoeffs = polyfit(data(:,1),data(:,2),1) ; % coefficients of linear fit vline = polyval(lcoeffs,data(:,1)) ; data(:,2) = data(:,2) - vline ; paramstruct = struct('imovie',0,... 'iout',2,... 'icolor',icolor,... 'nfspar',nspar,... 'nsspar',nspar,... 'famoltitle',famolstr,... 'xlabelstr',xstr,... 'ylabelstr',ystr,... 'savestr','foodfig2',... 'ihhighlight',0,... 'nrepeat',1,... 'iscreenwrite',1) ; sizer2ss(data,paramstruct) ; if isfield(paramstruct,'icolor') ; % then change to the given value icolor = getfield(paramstruct,'icolor') ; end ; if icolor==1, subplot(2,1,1) ; vachil = get(gca,'Children') ; set(vachil(1),'MarkerSize',2) ; set(vachil(1),'LineWidth',2) ; set(vachil(1),'Marker','o') ; set(vachil(1),'Color','g') ; end % Save graph as .eps file % vpos = get(gcf,'Position') ; ht2wdrat = vpos(4) / vpos(3) ; % height to width ratio paperwd = 3.5 ; % width of image on paper (inches) paperht = ht2wdrat * paperwd ; % height of image on paper (inches) % using this ratio keeps all labels and titles marginwd = (8.5 - paperwd) / 2 ; % widht of left margin on paper marginht = 9 - paperht ; % widht of bottom margin on paper % leaves image 2 inches down from top set(gcf,'PaperPosition',[marginwd, marginht, paperwd, paperht]) ; set(gcf,'PaperPositionMode','auto') ; %subplot(2,1,1);ylabel('Exp. for Food-Lfit'); orient portrait ; pstr = ['print -depsc ',figpath,'foodfig2.eps'] ; eval(pstr) ; time=etime(clock,time0); disp(['Time Used=',num2str(time)])