Skip to content
Snippets Groups Projects
Verified Commit d2401d14 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

plot_shock_decomposition: plot_init_date, plot_end_date

parent a0bdecd2
No related branches found
No related tags found
No related merge requests found
...@@ -104,6 +104,8 @@ handles.pushbuttonReset = uicontrol( ... ...@@ -104,6 +104,8 @@ handles.pushbuttonReset = uicontrol( ...
handles.use_shock_groups.Value = 0; handles.use_shock_groups.Value = 0;
handles.fig_name.String = ''; handles.fig_name.String = '';
handles.vintage.String = ''; handles.vintage.String = '';
handles.plot_init_date.String = '';
handles.plot_end_date.String = '';
end end
handles.pushbuttonCloseAll = uicontrol( ... handles.pushbuttonCloseAll = uicontrol( ...
...@@ -364,6 +366,44 @@ handles.pushbuttonClose = uicontrol( ... ...@@ -364,6 +366,44 @@ handles.pushbuttonClose = uicontrol( ...
'Position', [spc*3+dwidth*1.5 top-num*dheight dwidth*2 dheight/2], ... 'Position', [spc*3+dwidth*1.5 top-num*dheight dwidth*2 dheight/2], ...
'Value', 0); 'Value', 0);
num = num + 1;
uicontrol( ...
'Parent', handles.uipanelResults, ...
'Tag', 'plot_init_date', ...
'Style', 'text', ...
'Units', 'normalized', ...
'Position', [spc*3 top-num*dheight dwidth*1.5 dheight/2], ...
'String', 'plot_init_date:', ...
'HorizontalAlignment', 'left');
handles.plot_init_date = uicontrol( ...
'Parent', handles.uipanelResults, ...
'Tag', 'plot_init_date', ...
'String', '', ...
'Style', 'edit', ...
'Units', 'normalized', ...
'Position', [spc*3+dwidth*1.5 top-num*dheight dwidth*2 dheight/2], ...
'Value', 0);
num = num + 1;
uicontrol( ...
'Parent', handles.uipanelResults, ...
'Tag', 'plot_end_date', ...
'Style', 'text', ...
'Units', 'normalized', ...
'Position', [spc*3 top-num*dheight dwidth*1.5 dheight/2], ...
'String', 'plot_end_date:', ...
'HorizontalAlignment', 'left');
handles.plot_end_date = uicontrol( ...
'Parent', handles.uipanelResults, ...
'Tag', 'plot_end_date', ...
'String', '', ...
'Style', 'edit', ...
'Units', 'normalized', ...
'Position', [spc*3+dwidth*1.5 top-num*dheight dwidth*2 dheight/2], ...
'Value', 0);
num = num + 1; num = num + 1;
handles.use_shock_groups = uicontrol(... handles.use_shock_groups = uicontrol(...
'Parent', handles.uipanelResults, ... 'Parent', handles.uipanelResults, ...
...@@ -385,6 +425,34 @@ handles.pushbuttonClose = uicontrol( ... ...@@ -385,6 +425,34 @@ handles.pushbuttonClose = uicontrol( ...
end end
options_.plot_shock_decomp.vintage = str2double(handles.vintage.String); options_.plot_shock_decomp.vintage = str2double(handles.vintage.String);
if ~isempty(handles.plot_init_date.String)
if isint(str2double(handles.plot_init_date.String))
options_.plot_shock_decomp.plot_init_date = str2double(handles.plot_init_date.String);
elseif isdate(handles.plot_init_date.String)
options_.plot_shock_decomp.plot_init_date = dates(handles.plot_init_date.String);
else
gui_tools.show_warning('Initial date must be an integer or a date');
uicontrol(hObject);
return
end
else
options_.plot_shock_decomp.plot_init_date = '';
end
if ~isempty(handles.plot_end_date.String)
if isint(str2double(handles.plot_end_date.String))
options_.plot_shock_decomp.plot_end_date = str2double(handles.plot_end_date.String);
elseif isdate(handles.plot_end_date.String)
options_.plot_shock_decomp.plot_end_date = dates(handles.plot_end_date.String);
else
gui_tools.show_warning('End date must be an integer or a date');
uicontrol(hObject);
return
end
else
options_.plot_shock_decomp.plot_end_date = '';
end
if handles.colormap.Value ~= 1 if handles.colormap.Value ~= 1
options_.plot_shock_decomp.colormap = handles.colormap.String{handles.colormap.Value}; options_.plot_shock_decomp.colormap = handles.colormap.String{handles.colormap.Value};
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment