-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathspatialCrossplot.m
More file actions
57 lines (48 loc) · 1.6 KB
/
spatialCrossplot.m
File metadata and controls
57 lines (48 loc) · 1.6 KB
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
51
52
53
54
55
56
57
function spatialCrossplot(folderNames, filenumber)
% Cross plot function for IM7 images.
% Version: 0.1
% Author: Ben Falconer
% Synatx:
% folderList2=dir('*3CUp-TP4*us');
% folders2={folderList2.name}.'
% result = crossplot(folders2);
%Load our usual settings:
run('symphonySettings');
%Default to a velocity plot if none is specified:
if(nargin < 2)
filenumber = 4;
end
%sort filenames by D
folderNames = sortByAttribute(folderNames, 'd');
%Plot all lines to the same graph:
hold on;
%Define a colour map for the graph:
cmap = colormap('lines');
%Define some styles to use for the lines:
styles = {'-', '--', ':', '-.'};
%Create an array to contain the legend entries:
legendEntries = cell(size(folderNames));
for i=1:size(folderNames)
%For each folder we get and load the file corresponding to the
%appropriate property:
filename = [folderNames{i} '/B' sprintf('%05d', filenumber) '*.im7'];
v = im7Load(filename);
if i==1
%set our formatting if this is the first time we're running.
setSpatialCrossplotFormatting(v);
end
total = getProfileAtCoord(v,0) + str2double(getAttribute(v.setname, 'd'))*D;
plot(total, v.x, ... %Plot our x Axis points against the profile
'color', cmap(i,:), ... %Use the colours we defined earlier
'lineStyle', styles{ceil(i/7)},... %Use the line styles we defined earlier (7 is the period of the line colours)
'LineWidth',1.5);
legendEntries{i} = [getAttribute(v.setname, 'd') 'D'];
end
range = xlim;
ticks = 0:D:range(2);
set(gca, 'XTick', ticks);
set(gca,'XTickLabel', ticks/D)
%Add the legend:
legend(legendEntries);
hold off;
end