% letter plot for covariance close all; msize = 9; psize = 20; linewidth = 1.25; dftcolors = colororder; markers = {'s', '*', 'x', 'o'}; params = [1,0.99,1-1e-4 ]; opts = optimset('Display','off'); widthpix = 300; heightpix = 200; linewidth = 1.25; leftmargin = 105; bottommargin = 75; topmargin = 70; rightmargin = 75; centermargin = 0; widthtotal = widthpix*2.5+leftmargin+rightmargin; heighttotal = heightpix*2+topmargin+bottommargin; left = leftmargin/widthtotal; bottom = bottommargin/heighttotal; width = widthpix/widthtotal; height = heightpix/heighttotal; %% main plot nowpanel = axes('Position', [left, bottom, width*1.5, height*2]); phihat = 5; dims = {'4D', '8D', '12D', '16D', '20D'}; n=length(dims); rpp=(1:n)'; colors = [(rpp-1)/(n-1), zeros(n,1), 1 - (rpp-1)/(n-1)]; for rp=1:length(dims) dim = dims{rp}; ndim = str2double(dim(1:end-1)); ndimsqr = ndim*ndim*ndim; phistr = num2str(phihat*ndim); fname = strcat('../data/rlgdynamics/', dim, '/', phistr, '/msd.dat'); data = dlmread(fname, '', 1, 0); xs = data(:,1)*sqrt(ndim); ys = ( ndim^2*data(:,5) ./ data(:,2).^2 - 1); plot(xs, ys, 'color', colors(rp,:) ); if phihat < 5 meanys = mean(ys(floor(end/2):end)); else meanys = mean(ys(end-4:end)); end fprintf('%g\t%g\t%g\n', phihat, ndim, meanys); if 1==rp, hold on, end end set(gca, 'xscale', 'log'); xlabel('$\hat{t}$', 'interpreter', 'latex'); ylabel('$ \mathrm{C}(\hat{t})$', 'interpreter', 'latex'); xlim([1e-1,1e5]); ylim([-0.2, 1.08]); xticks([1e0,1e2,1e4]); yticks([-0.5, 0, 0.5, 1]); set(gca, 'fontname', 'times new roman', 'fontsize', psize); %% inset (b) panelB = axes('Position', [left+width*1.5, bottom+height, width, height]); alldata = dlmread('../data/rlgdynamics/rcovpfactor.dat'); phis = [3.5, 4, 5, 7, 10, 15, 20, 30, 40]; pltphis = [3.5, 5, 10, 20, nan]; n=length(pltphis)-1; rpp=(1:n)'; colorsB = [1 - (rpp-1)/(n-1), (rpp-1)/(n-1), zeros(n,1)]; nowplt = 1; allrst = []; for rp=1:length(phis) phihat = phis(rp); takes = alldata(:,1)==phihat; xs = 1 ./ alldata(takes, 2); ys = alldata(takes, 3); xs = [xs, ones(numel(xs), 1)]; [b, bint] = regress(ys(2:end), xs(2:end,:)); allrst = [allrst; phihat, b(1), (bint(1,2)-bint(1,1))/2]; if phihat == pltphis(nowplt) xreg = linspace(0, max(xs(:,1))*1.02); yreg = b(1)*xreg + b(2); plot(xreg, yreg, 'color', colorsB(nowplt,:) ); if 1==nowplt hold on; end plot(xs(:,1), ys, 'x', 'markersize', msize, 'linewidth', 1.5, 'color',colorsB(nowplt,:) ); nowplt = nowplt + 1; end end xlim([0, 0.26]); xticks([0, 0.1 , 0.2]); yticks([0, 1, 2]); xx = gca; xx.XRuler.TickLength = [0.02, 0]; xx.YRuler.TickLength = [0.03, 0]; xlabel('$1/d$', 'interpreter', 'latex'); ylabel('$\mathrm{C}(\hat{t} \rightarrow \infty)$', 'interpreter', 'latex'); set(panelB, 'XAxisLocation', 'top', 'YAxisLocation', 'right'); set(panelB, 'fontname', 'times new roman', 'fontsize', psize); %% inset (c) panelC = axes('Position', [left+width*1.5, bottom, width, height]); plot( allrst(:,1), allrst(:,2), 'xk:', 'markersize', msize, 'linewidth', 1.5); hold on; plot([2.40339, 2.40339], [2, 7], '--k'); xlim([0, 40.1]); ylim([2, 7]); xticks([0, 20, 40]); yticks([2, 4, 6]); xx = gca; xx.XRuler.TickLength = [0.02, 0]; xx.YRuler.TickLength = [0.03, 0]; xlabel('$\hat\varphi$', 'interpreter', 'latex'); ylabel('$\hat{\mathrm{C}}(\hat{t} \rightarrow \infty)$', 'interpreter', 'latex'); set(panelC, 'YAxisLocation', 'right'); set(panelC, 'fontname', 'times new roman', 'fontsize', psize); annotation('textbox',[0.12, 0.78, 0.1, 0.1], 'String', '(a)', 'EdgeColor','none', 'Fontname', 'Times New Roman','fontsize',psize); annotation('textbox',[0.84, 0.78, 0.1, 0.1], 'String', '(b)', 'EdgeColor','none', 'Fontname', 'Times New Roman','fontsize',psize); annotation('textbox',[0.84, 0.41, 0.1, 0.1], 'String', '(c)', 'EdgeColor','none', 'Fontname', 'Times New Roman','fontsize',psize); print('../figures/rlgmf_ncov.eps', '-depsc');