%% Generate an undecorated version of Figure 8 function []=Figure8() angular_momenta=1:16; % angular momentum for ii=1:size(angular_momenta,2) angular_index=angular_momenta(ii); ylimhigh=0.06; % y-axis range if angular_index<5 ylimhigh=0.006; end if angular_index==5 || angular_index>8 ylimhigh=0.04; end if angular_index==6 || angular_index==7 ylimhigh=0.1; end if angular_index==8 ylimhigh=0.06; end figure(); hold on xiPTS=1; % guessed value for the first packing fraction for temperature_index=1:5 % temperature_index=1 corresponds to temperature T1=1.000; % temperature_index=2 corresponds to temperature T2=0.800; % temperature_index=3 corresponds to temperature T3=0.600; % temperature_index=4 corresponds to temperature T4=0.510; % temperature_index=5 corresponds to temperature T5=0.450; %% Read in the data data_name=sprintf('./l=%dPTS_T%d.dat',angular_index,temperature_index); fid = fopen(data_name,'r'); numbers=fscanf(fid, '%f'); fclose('all'); Nr=round(size(numbers,1)/3);% number of radial data points numbers=reshape(numbers,3,Nr); R=numbers(1,1:Nr).'; % cavity radii where bond-orientational point-to-set correlation functions are measured gPTS=numbers(2,1:Nr).'; % bond-orientational point-to-set correlation functions gPTS_error=numbers(3,1:Nr).'; % error bars %% Stretched exponential fit, A*exp(-(r/xiPTS)^3) gamma=3; x=R; y=gPTS; Init=[ylimhigh, xiPTS]; weight=diag(ones(size(x))); Outliers=false(size(x)); [fit_values,confidence_intervals]=fixed_streched_exponential_decay_fit(x,y,weight,Init,Outliers,gamma); A=fit_values(1); xiPTS=fit_values(2); xiPTS_error=1.96*(confidence_intervals(2,2)-confidence_intervals(1,2))/2; % 95-percent confidence interval R_fit=0:0.01:20; gPTS_fit=A*exp(-(R_fit/xiPTS).^gamma); %% Plot them plot(R_fit,gPTS_fit) errorbar(R,gPTS,gPTS_error,'Linestyle','none','Marker','.') end xlabel('$R$','Interpreter','latex') ylabel('$g^{\rm PTS}$','Interpreter','latex'); xlim([1,4]) ylim([0,ylimhigh]) axis square set(gcf, 'PaperPositionMode', 'auto'); % Print out if angular_index==1 print -depsc2 Figure8_l=1.eps end if angular_index==2 print -depsc2 Figure8_l=2.eps end if angular_index==3 print -depsc2 Figure8_l=3.eps end if angular_index==4 print -depsc2 Figure8_l=4.eps end if angular_index==5 print -depsc2 Figure8_l=5.eps end if angular_index==6 print -depsc2 Figure8_l=6.eps end if angular_index==7 print -depsc2 Figure8_l=7.eps end if angular_index==8 print -depsc2 Figure8_l=8.eps end if angular_index==9 print -depsc2 Figure8_l=9.eps end if angular_index==10 print -depsc2 Figure8_l=10.eps end if angular_index==11 print -depsc2 Figure8_l=11.eps end if angular_index==12 print -depsc2 Figure8_l=12.eps end if angular_index==13 print -depsc2 Figure8_l=13.eps end if angular_index==14 print -depsc2 Figure8_l=14.eps end if angular_index==15 print -depsc2 Figure8_l=15.eps end if angular_index==16 print -depsc2 Figure8_l=16.eps end end end