-
Notifications
You must be signed in to change notification settings - Fork 0
/
biexponential_plots.m
73 lines (58 loc) · 2.15 KB
/
biexponential_plots.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
function biexponential_plots
addpath(genpath('MATLAB_Utilities'));
P1 = 0.7 * 255; % DRX amp
P2 = 0.3 * 255; % SRX amp
T1 = 1/20; % DRX rate
T2 = 1/120; % SRX rate
offset = 10;
t = 0:300; %this is time starts at 0 ends at 300
y = P1*exp(-T1*t) + P2*exp(-T2*t) + offset;
y_fast = P1*exp(-T1*t);
y_slow = P2*exp(-T2*t);
right_subplot_adjustments = zeros(1, 1);
height_subplot_adjustments = zeros(1, 1);
right_subplot_adjustments(1) = 1.5;
height_subplot_adjustments(1) = -2.5;
bottom_subplot_adjustments(1) = 0;
sp = initialise_publication_quality_figure( ...
'no_of_panels_wide', 1, ...
'no_of_panels_high', 1, ...
'top_margin', 0.6, ...
'bottom_margin', 0, ...
'right_margin', 1, ...
'individual_padding', 1, ...
'left_pads', repmat([1.3 0.15 0.15],[1 2]), ...
'right_pads', repmat([0.15 0.15 0.15],[1 2]), ...
'axes_padding_top', -2.5, ...
'axes_padding_bottom',0.5, ...
'panel_label_font_size', 0,...
'right_subplot_adjustments',right_subplot_adjustments,...
'height_subplot_adjustments',height_subplot_adjustments,...
'bottom_subplot_adjustments',bottom_subplot_adjustments);
p = plot(t,y/max(y),"LineWidth",2,'Color','k');
hold on
p_fast = plot(t,y_fast/max(y),"LineWidth",2,'Color','g');
p_slow = plot(t,y_slow/max(y),"LineWidth",2,'Color','r');
improve_axes(...
'x_tick_decimal_places',0, ...
'y_tick_decimal_place',0, ...
'y_axis_offset',0.065,...
'y_axis_label',{'Normalised','Intensity'},...
'x_label_offset',-.085,...
'y_label_offset',-0.15,...
'x_axis_label',{'Time (s)'},...
'x_tick_label_vertical_offset',-0.05,...
'y_axis_off',0,...
'gui_scale_factor',0)
legendflex([p p_fast p_slow], {'Double Exponential Fit','DRX (Fast Phase)','SRX (Slow Phase)'}, ...
'xscale',1, ...
'anchor',{'ne','ne'}, ...
'buffer',[8 0], ...
'padding',[1 1 2], ...
'FontSize',10, ...
'text_y_padding', -2);
image_formats = {'png'};
figure_export( ...
'output_file_string', sprintf('bi_exp_plot'), ...
'output_type', image_formats{1});
end