File data_analysis/@entanglement_evaluation/plot_logneg_gammalist.m changed (mode: 100644) (index 83a5fd7..d55dc71) |
1 |
|
function plot_logneg_gammalist(ev, power_ind) |
|
|
1 |
|
function plot_logneg_gammalist(ev, power_ind, varargin) |
|
2 |
|
symmetric = false; |
|
3 |
|
for k=1:2:length(varargin) |
|
4 |
|
switch varargin{k} |
|
5 |
|
case {'symmetric', 'Symmetric'} |
|
6 |
|
symmetric = varargin{k+1}; |
|
7 |
|
otherwise |
|
8 |
|
error(['Unrecognized varargin-argument ', varargin{k}]) |
|
9 |
|
end |
|
10 |
|
end |
|
11 |
|
|
2 |
12 |
pulse_widths_factorized = allcomb_invert(ev.pulse_widths); |
pulse_widths_factorized = allcomb_invert(ev.pulse_widths); |
3 |
13 |
|
|
4 |
14 |
% right now, we only support plotting mode 1 on x and mode 2 on y |
% right now, we only support plotting mode 1 on x and mode 2 on y |
|
... |
... |
function plot_logneg_gammalist(ev, power_ind) |
10 |
20 |
x_labels = cellfun(@num2eng, num2cell(x_labels(:)), 'UniformOutput', false); |
x_labels = cellfun(@num2eng, num2cell(x_labels(:)), 'UniformOutput', false); |
11 |
21 |
|
|
12 |
22 |
y_labels = pulse_widths_factorized{y_mode_no}; |
y_labels = pulse_widths_factorized{y_mode_no}; |
|
23 |
|
y_labels = flipud(y_labels); |
13 |
24 |
y_labels = cellfun(@num2eng, num2cell(y_labels(:)), 'UniformOutput', false); |
y_labels = cellfun(@num2eng, num2cell(y_labels(:)), 'UniformOutput', false); |
14 |
25 |
|
|
15 |
26 |
% reshape data to be consistent with axis labelling |
% reshape data to be consistent with axis labelling |
16 |
27 |
data = reshape(cell2mat(ev.logneg_corrected{power_ind})',... |
data = reshape(cell2mat(ev.logneg_corrected{power_ind})',... |
17 |
28 |
length(x_labels), length(y_labels)); |
length(x_labels), length(y_labels)); |
18 |
|
data_max = max(max(data)); |
|
19 |
|
data_min = min(min(data)); |
|
20 |
|
extremum = max([abs(data_min), data_max]); |
|
|
29 |
|
data = flipud(data); |
21 |
30 |
|
|
22 |
31 |
% plot |
% plot |
23 |
32 |
ncolors = 128; |
ncolors = 128; |
24 |
|
cmap = cbrewer('div', 'RdBu', 128); |
|
25 |
|
%Divergent tables:'BrBG', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn' |
|
26 |
|
heatmap(data, x_labels, y_labels, '%0.3f',... |
|
27 |
|
'Colormap', cmap, 'Colorbar', true,... |
|
28 |
|
'MinColorValue',-extremum, 'MaxColorValue',extremum,... |
|
29 |
|
'GridLines', ':', 'TextColor', 'k',... |
|
30 |
|
'ColorLevels',ncolors); |
|
31 |
|
xlabel(['Width [Hz] for mode with central frequency ', num2eng(ev.mech_frequencies(x_mode_no)),'Hz']) |
|
32 |
|
ylabel(['Width [Hz] for mode with central frequency ', num2eng(ev.mech_frequencies(y_mode_no)),'Hz']) |
|
|
33 |
|
if symmetric |
|
34 |
|
cmap = cbrewer('div', 'RdBu', 128); |
|
35 |
|
%Divergent tables:'BrBG', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn' |
|
36 |
|
|
|
37 |
|
data_max = max(max(data)); |
|
38 |
|
data_min = min(min(data)); |
|
39 |
|
extremum = max([abs(data_min), data_max]); |
33 |
40 |
|
|
|
41 |
|
heatmap(data, x_labels, y_labels, '%0.3f',... |
|
42 |
|
'Colormap', cmap, 'Colorbar', true,... |
|
43 |
|
'MinColorValue',-extremum, 'MaxColorValue',extremum,... |
|
44 |
|
'GridLines', ':', 'TextColor', 'k',... |
|
45 |
|
'ColorLevels', ncolors); |
|
46 |
|
else |
|
47 |
|
cmap = cbrewer('seq', 'Blues', 128); |
|
48 |
|
% Sequential tables:'Blues','BuGn','BuPu','GnBu','Greens','Greys','Oranges','OrRd','PuBu','PuBuGn','PuRd','Purples','RdPu','Reds','YlGn','YlGnBu','YlOrBr','YlOrRd','Spectral' |
|
49 |
|
|
|
50 |
|
heatmap(data, x_labels, y_labels, '%0.3f',... |
|
51 |
|
'Colormap', cmap, 'Colorbar', true,... |
|
52 |
|
'GridLines', ':', 'TextColor', 'k',... |
|
53 |
|
'ColorLevels', ncolors); |
|
54 |
|
end |
|
55 |
|
xlabel(['Width [Hz] for mode with central frequency ', num2eng(ev.mech_frequencies(x_mode_no)),'Hz']) |
|
56 |
|
ylabel(['Width [Hz] for mode with central frequency ', num2eng(ev.mech_frequencies(y_mode_no)),'Hz']) |
|
57 |
|
|
34 |
58 |
% export to ev.evaluation_folder |
% export to ev.evaluation_folder |
35 |
59 |
wherewasi = cd; |
wherewasi = cd; |
36 |
60 |
cd(ev.evaluation_folder); |
cd(ev.evaluation_folder); |