%% Generate an undecorated version of Figure 3(b) function []=Figure3b() %% Decide where to plot the probability distribution function (PDF) temperature_index=6; % T=temperature=0.51 R_index=5; % R=cavity_size=2.6 %% Read in the data % Static point-to-set overlaps data_name=sprintf('./PTS%d_%d.dat',temperature_index,R_index); fid = fopen(data_name,'r'); numbers=fscanf(fid, '%f'); fclose('all'); qPTSs=numbers; Ncavity=size(numbers,1); % Dynamical overlaps data_name=sprintf('./Dynamical_overlap%d.dat',temperature_index); fid = fopen(data_name,'r'); numbers=fscanf(fid, '%f'); fclose('all'); qDs=numbers; %% Histogram them into bins q_bins=((-0.025):0.025:1)+0.5*(0.025); Ng=size(q_bins,2); ys=(q_bins.')*ones(1,Ng); xs=ys.'; PDF=zeros(Ng,Ng); % For a given data point, loacte to which bin it belongs for i=1:Ncavity x=qPTSs(i); y=qDs(i); [~,kx]=min(abs(q_bins-x)); [~,ky]=min(abs(q_bins-y)); PDF(kx,ky)=PDF(kx,ky)+1; end PDF=PDF/(0.025*0.025*Ncavity); %% Smoothen PDF x_refine=(xs(1,1):0.001:xs(1,end)); y_refine=(ys(1,1):0.001:ys(end,1)); [X,Y]=meshgrid(x_refine,y_refine); PDF=interp2(xs,ys,PDF,X,Y,'spline'); %% Plot the data close all; figure(1); color_map=hot(1024); colormap(color_map) surf(X.',Y.',PDF,PDF,'EdgeColor','none','FaceColor','interp') %% Label axis and print it out xlabel('$\bar{q}_{\rm PTS}$','Interpreter','latex') ylabel('$\bar{q}_{\rm dyn}$','Interpreter','latex') xlim([0,0.8]) ylim([0,0.8]) view([0,90]) axis square set(gcf, 'PaperPositionMode', 'auto'); print -depsc2 Figure3b.eps end