add option colormap for shocks_decomposition

time-shift
Michel Juillard 2016-04-14 21:22:31 +02:00
parent de567377c3
commit 800d79d6e5
3 changed files with 7 additions and 1 deletions

View File

@ -28,6 +28,8 @@ function []=graph_decomp(z,shock_names,endo_names,i_var,initial_date,DynareModel
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
new_colormap = DynareOptions.colormap;
% number of components equals number of shocks + 1 (initial conditions)
comp_nbr = size(z,2)-1;
@ -98,6 +100,9 @@ for j=1:nvar
y1 = y1 + height;
end
if ~isempty(new_colormap)
colormap(new_colormap)
end
dyn_saveas(fhandle,[DynareModel.fname,'_shock_decomposition_',deblank(endo_names(i_var(j),:))],DynareOptions);
hold off
if DynareOptions.TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format)))

View File

@ -3117,7 +3117,7 @@ o_sampling_draws : SAMPLING_DRAWS EQUAL INT_NUMBER { driver.option_num("sampling
o_use_shock_groups : USE_SHOCK_GROUPS { driver.option_str("use_shock_groups","default"); }
| USE_SHOCK_GROUPS EQUAL symbol { driver.option_str("use_shock_groups", $3); }
;
o_colormap : COLORMAP EQUAL symbol { driver.option_str("colormap",$3); };
o_colormap : COLORMAP EQUAL symbol { driver.option_num("colormap",$3); };
range : symbol ':' symbol
{

View File

@ -795,6 +795,7 @@ DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2
<DYNARE_STATEMENT>gsa_sample_file {return token::GSA_SAMPLE_FILE;}
<DYNARE_STATEMENT>use_shock_groups {return token::USE_SHOCK_GROUPS;}
<DYNARE_STATEMENT>colormap {return token::COLORMAP;}
<DYNARE_STATEMENT,DYNARE_BLOCK>[A-Za-z_][A-Za-z0-9_]* {
yylval->string_val = new string(yytext);