-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotVarExplainedCompareClusterStatusBodywall.m
50 lines (46 loc) · 1.69 KB
/
plotVarExplainedCompareClusterStatusBodywall.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
% combine projected amplitudes in space of first two eigenworms
% issues/to-do:
% -
close all
clear
% figure export options
exportOptions = struct('Format','eps2',...
'Color','rgb',...
'Width',10,...
'Resolution',300,...
'FontMode','fixed',...
'FontSize',10,...
'LineWidth',1,...
'Renderer','painters');
strains = {'npr1'}%,'N2'};
nStrains = length(strains);
wormnums = {'40'}%{'HD','40'};
plotColors = lines(nStrains);
for numCtr = 1:length(wormnums)
N = wormnums{numCtr};
varFig = figure;
for strainCtr = 1:nStrains
S = strains{strainCtr};
% load eigenworm data
file = rdir(['results/eigenData_' S '_' N '_bodywall_loneWorms_joining.mat']);
% load eigenworm analysis result
load(file.name,'masterVarExplained');
plot(0:6,cumsum([0; masterVarExplained]),'--o','Color',plotColors(strainCtr,:),'LineWidth',2)
hold on
% load eigenworm data
file = rdir(['results/eigenData_' S '_' N '_bodywall_inCluster_joining.mat']);
% load eigenworm analysis result
load(file.name,'masterVarExplained');
plot(0:6,cumsum([0; masterVarExplained]),'--x','Color',plotColors(strainCtr,:),'LineWidth',2)
end
ax = gca;
ax.YLabel.String = '% variance explained';
ax.XLabel.String = 'eigenworm';
% annotate and save figure
legend({'npr-1 lone','npr-1 cluster','N2 lone','N2 cluster'},'Location','SouthEast')
% title(['variance explained for lone (-o) and in cluster (-x) eigenworms'],'FontWeight','normal')
figName = ['figures/varExplained_CompareClusterStatus.eps'];
exportfig(varFig,figName,exportOptions)
system(['epstopdf ' figName]);
system(['rm ' figName]);
end