-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCOS_plot.m
49 lines (29 loc) · 932 Bytes
/
COS_plot.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
function [ axes ] = COS_plot( wn1,wn2, COS, levels )
%COS_PLOT Summary of this function goes here
% Detailed explanation goes here
fig = figure();
[x, y] = meshgrid(wn1,wn2);
abs_max = max(max(abs(COS)));
if length(levels) == 1
contour_levels = linspace(-abs_max, abs_max, 2*levels+1);
last_neg = contour_levels(levels);
else
contour_levels = [-levels,levels] * abs_max;
num_levels = length(levels);
last_neg = max(contour_levels(contour_levels<0));
end
colormap gray;
size(y)
COS_neg = COS;
COS_neg(COS > last_neg) = 0;
hold on;
contourf(x,y,COS_neg,50,'edgecolor','none');
caxis([min(min(contour_levels)), last_neg]);
contour(x,y,COS,contour_levels(contour_levels >0), 'edgecolor','black');
contour(x,y,COS,contour_levels(contour_levels <0), 'edgecolor','black','linestyle','--');
set(gca, 'XDir', 'reverse', 'YDir','reverse');
axis image;
xlabel('\nu_1')
ylabel('\nu_2')
hold off;
end