%% Generate an undecorated version of the top row of Figure 1 function []=Figure1top() cavity_size=6.25; % size of the cavity %% Set figure parameters dotsize_adjust=300; % adjustment to rightly represent the size of disks %the right number depends on a particular environment (see the bottom of the code) L=20; % linear size of the figure range Lh=L/2; % Coloring Ncolor=1000; color_map=hot(Ncolor); color_map=1-color_map; color_map(1:300,1)=1; color_map(1:300,2)=1; color_map(1:300,3)=1; %% Positional overlap % Read in the data data_name=sprintf('snappos.dat'); fid = fopen(data_name,'r'); numbers=fscanf(fid, '%f'); fclose('all'); N=round(size(numbers,1)/4); % number of particles numbers=(reshape(numbers,4,N)); X=numbers(1,1:N).'; % x-coordinate Y=numbers(2,1:N).'; % y-coordinate Q=numbers(3,1:N).'; % Q-values sigmas=numbers(4,1:N).'; % sigmas, i.e., particle diameters % Generate figure and print it out figure(1); hold on; xlim([-Lh,Lh]) ylim([-Lh,Lh]) for i=1:N x=X(i); y=Y(i); r=sqrt(x^2+y^2); sigma=dotsize_adjust*sigmas(i); q=Q(i); i_color=round(Ncolor*q); i_color=max(i_color,1); i_color=min(i_color,Ncolor); % Color particles outside the cavity black if (r>=cavity_size) i_color=Ncolor; end color=color_map(i_color,:); scatter(x,y,sigma,color,'filled','MarkerEdgeColor',[0,0,0]) end axis square off set(gcf, 'PaperPositionMode', 'auto'); print -depsc2 Figure1topfirst.eps %% l=6 overlap [overlap values on disks outside the cavity (strongly flucuating with average=1) uniformly set to 1, for clarity] % Read in the data data_name=sprintf('snap6.dat'); fid = fopen(data_name,'r'); numbers=fscanf(fid, '%f'); fclose('all'); N=round(size(numbers,1)/4); % number of particles numbers=(reshape(numbers,4,N)); X=numbers(1,1:N).'; % x-coordinate Y=numbers(2,1:N).'; % y-coordinate Q=numbers(3,1:N).'; % Q-values sigmas=numbers(4,1:N).'; % sigmas, i.e., particle diameters % Generate figure and print it out figure(6); hold on; xlim([-Lh,Lh]) ylim([-Lh,Lh]) for i=1:N x=X(i); y=Y(i); r=sqrt(x^2+y^2); sigma=dotsize_adjust*sigmas(i); q=Q(i); i_color=round(Ncolor*q); i_color=max(i_color,1); i_color=min(i_color,Ncolor); % Color particles outside the cavity black if (r>=cavity_size) i_color=Ncolor; end color=color_map(i_color,:); scatter(x,y,sigma,color,'filled','MarkerEdgeColor',[0,0,0]) end axis square off set(gcf, 'PaperPositionMode', 'auto'); print -depsc2 Figure1topsecond.eps %% l=8 overlap [overlap values on disks outside the cavity (strongly flucuating with average=1) uniformly set to 1, for clarity] % Read in the data data_name=sprintf('snap8.dat'); fid = fopen(data_name,'r'); numbers=fscanf(fid, '%f'); fclose('all'); N=round(size(numbers,1)/4); % number of particles numbers=(reshape(numbers,4,N)); X=numbers(1,1:N).'; % x-coordinate Y=numbers(2,1:N).'; % y-coordinate Q=numbers(3,1:N).'; % Q-values sigmas=numbers(4,1:N).'; % sigmas, i.e., particle diameters % Generate figure and print it out figure(8); hold on; xlim([-Lh,Lh]) ylim([-Lh,Lh]) for i=1:N x=X(i); y=Y(i); r=sqrt(x^2+y^2); sigma=dotsize_adjust*sigmas(i); q=Q(i); i_color=round(Ncolor*q); i_color=max(i_color,1); i_color=min(i_color,Ncolor); % Color particles outside the cavity black if (r>=cavity_size) i_color=Ncolor; end color=color_map(i_color,:); scatter(x,y,sigma,color,'filled','MarkerEdgeColor',[0,0,0]) end axis square off set(gcf, 'PaperPositionMode', 'auto'); print -depsc2 Figure1topthird.eps % %% Adjust ``dotsize_adjust," depending on the MATLAB environment, making the red dot just fill up the circle % x=X(1); % y=Y(1); % radius=sigmas(1)/2; % sigma=dotsize_adjust*sigmas(1); % color=[1,0,0]; % scatter(x,y,sigma,color,'filled') % viscircles([x,y],radius,'Linewidth',0.1,'LineStyle','-','EdgeColor',[0,0,0]) end