-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRipleyPlot.m
executable file
·36 lines (30 loc) · 930 Bytes
/
RipleyPlot.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function fig = RipleyPlot(r_hist,H_all,color,title_plot,ylimits)
if strcmp(color,'red')
light = [1 0.8 0.8];
dark = [0.7 0 0];
elseif strcmp(color,'green')
light = [0.8 1 0.8];
dark = [0 0.7 0];
elseif strcmp(color,'blue')
light = [0.8 0.8 1];
dark = [0 0 0.7];
else
disp('Pick a valid colour for RipleyPlot.')
end
fig = figure;
% Ripley curves for all the ROIs
h1 = plot(r_hist,H_all,'Color',light);
hold on
% Mean of the Ripley curves of all the ROIs
H_all_mean = mean(H_all,2);
h2 = plot(r_hist,H_all_mean,'Color',dark,'LineWidth',1.5);
[idx_x,~] = getCoordinatesMax(r_hist,H_all_mean);
l = line([idx_x idx_x], [0 max(H_all_mean)],'Color','black','LineStyle','--','LineWidth',1.5);
hold on
xlabel('r (nm)');
ylabel('Ripley''s L(r) - r function');
title(title_plot);
legend([h1(1) h2 l],{'Data','Mean','Estimate radius'},'Location','southeast');
set(gca,'fontsize',14);
ylim(ylimits)
end