Merge branch 'master' into use-dseries

time-shift
Stéphane Adjemian (Scylla) 2014-06-23 15:15:48 +02:00
commit a0907b2e05
6 changed files with 18 additions and 10 deletions

View File

@ -896,8 +896,8 @@ r = report();
@# for var in endovars @# for var in endovars
r = r.addGraph(`data', shock@{shock}.@{var}, `title', `@{var}', ... r = r.addGraph(`data', shock@{shock}.@{var}, `title', `@{var}', ...
`showGrid', false, `yTickLabelPrecision', 2, ... `showGrid', false, `yTickLabelPrecision', 2, ...
`yTickLabelZeroFill', false); `yTickLabelZeroFill', false, ...
r = r.addSeries(`graphHline', 0, `graphLineColor', `red'); `showZeroLine', true, `zeroLineColor', 'red');
@# endfor @# endfor
r = r.addVspace(`number', 2); r = r.addVspace(`number', 2);
r = r.addSection(`cols', 1); r = r.addSection(`cols', 1);

View File

@ -11239,7 +11239,7 @@ command. Default: @code{`!'}
@end defmethod @end defmethod
@anchor{addGraph} @anchor{addGraph}
@defmethod Report addGraph data, graphDirName, graphName, graphSize, height, showGrid, showLegend, showLegendBox, legendLocation, legendOrientation, legendFontSize, miscTikzAxisOptions, miscTikzPictureOptions, seriesToUse, shade, shadeColor, shadeOpacity, title, width, xlabel, ylabel, xAxisTight, xrange, xTicks, xTickLabels, xTickLabelAnchor, xTickLabelRotation, yAxisTight, yTickLabelFixed, yTickLabelPrecision, yTickLabelZeroFill, yrange, showZeroline @defmethod Report addGraph data, graphDirName, graphName, graphSize, height, showGrid, showLegend, showLegendBox, legendLocation, legendOrientation, legendFontSize, miscTikzAxisOptions, miscTikzPictureOptions, seriesToUse, shade, shadeColor, shadeOpacity, title, width, xlabel, ylabel, xAxisTight, xrange, xTicks, xTickLabels, xTickLabelAnchor, xTickLabelRotation, yAxisTight, yTickLabelFixed, yTickLabelPrecision, yTickLabelZeroFill, yrange, showZeroline, zeroLineColor
Adds a @code{Graph} to a @code{Section}. Adds a @code{Graph} to a @code{Section}.
@optionshead @optionshead
@table @code @table @code
@ -11390,9 +11390,14 @@ The precision with which to report the yTickLabel. Default: @code{1}
@item yTickLabelZeroFill, @code{BOOLEAN} @item yTickLabelZeroFill, @code{BOOLEAN}
Whether or not to fill missing precision spots with zeros. Default: @code{true} Whether or not to fill missing precision spots with zeros. Default: @code{true}
@anchor{showZeroLine}
@item showZeroline, @code{BOOLEAN} @item showZeroline, @code{BOOLEAN}
Display a solid black line at @math{y = 0}. Default: @code{false} Display a solid black line at @math{y = 0}. Default: @code{false}
@item zeroLineColor, @code{`red'} | @code{`green'} | @code{`blue'} | @code{`cyan'} | @code{`magenta'} | @code{`yellow'} | @code{`black'} | @code{`gray'} | @code{`darkgray'} | @code{`lightgray'} | @code{`brown'} | @code{`lime'} | @code{`olive'} | @code{`orange'} | @code{`pink'} | @code{`purple'} | @code{`teal'} | @code{`violet'} | @code{`white'}
The color to use for the zero line. Only used if @ref{showZeroLine} is
true. Default: @code{`black'}
@end table @end table
@end defmethod @end defmethod

View File

@ -1,4 +1,4 @@
function [flag,endo_simul,err] = solve_stochastic_perfect_foresight_model_1(endo_simul,exo_simul,Options,pfm,order,varargin) function [flag,endo_simul,err,y] = solve_stochastic_perfect_foresight_model_1(endo_simul,exo_simul,Options,pfm,order,varargin)
% Copyright (C) 2012-2013 Dynare Team % Copyright (C) 2012-2013 Dynare Team
% %
@ -63,7 +63,6 @@ if ~isempty(k)
else else
error('there is no nodes equal to zero') error('there is no nodes equal to zero')
end end
if hybrid_order > 0 if hybrid_order > 0
if hybrid_order == 2 if hybrid_order == 2
h_correction = 0.5*dr.ghs2(dr.inv_order_var); h_correction = 0.5*dr.ghs2(dr.inv_order_var);
@ -97,7 +96,7 @@ block_nbr = pfm.block_nbr;
dimension = ny*block_nbr; dimension = ny*block_nbr;
pfm.dimension = dimension; pfm.dimension = dimension;
if order == 0 if order == 0
i_upd_r = (1:ny*periods); i_upd_r = (1:ny*periods)';
i_upd_y = i_upd_r + ny; i_upd_y = i_upd_r + ny;
else else
i_upd_r = zeros(dimension,1); i_upd_r = zeros(dimension,1);

View File

@ -62,6 +62,7 @@ o.legendOrientation = 'horizontal';
o.legendFontSize = 'tiny'; o.legendFontSize = 'tiny';
o.showZeroline = false; o.showZeroline = false;
o.zeroLineColor = 'black';
o.graphSize = []; o.graphSize = [];
o.xTicks = []; o.xTicks = [];
@ -132,12 +133,13 @@ assert(ischar(o.xTickLabelAnchor), '@graph.graph: xTickLabelAnchor must be a str
assert(isint(o.yTickLabelPrecision), '@graph.graph: o.yTickLabelPrecision must be an integer'); assert(isint(o.yTickLabelPrecision), '@graph.graph: o.yTickLabelPrecision must be an integer');
assert(islogical(o.yTickLabelFixed), '@graph.graph: yTickLabelFixed must be either true or false'); assert(islogical(o.yTickLabelFixed), '@graph.graph: yTickLabelFixed must be either true or false');
assert(islogical(o.yTickLabelZeroFill), '@graph.graph: yTickLabelZeroFill must be either true or false'); assert(islogical(o.yTickLabelZeroFill), '@graph.graph: yTickLabelZeroFill must be either true or false');
valid_shadeColor = {'red', 'green', 'blue', 'cyan ', 'magenta', 'yellow', ... valid_shadeColor = {'red', 'green', 'blue', 'cyan ', 'magenta', 'yellow', ...
'black', 'gray', 'darkgray', 'lightgray', 'brown', ... 'black', 'gray', 'darkgray', 'lightgray', 'brown', ...
'lime', 'olive', 'orange', 'pink', 'purple', 'teal', 'violet', 'white'}; 'lime', 'olive', 'orange', 'pink', 'purple', 'teal', 'violet', 'white'};
assert(any(strcmp(o.shadeColor, valid_shadeColor)), ['@graph.graph: shadeColor must be one of ' ... assert(any(strcmp(o.shadeColor, valid_shadeColor)), ['@graph.graph: shadeColor must be one of ' ...
strjoin(valid_shadeColor)]); strjoin(valid_shadeColor)]);
assert(any(strcmp(o.zeroLineColor, valid_shadeColor)), ...
['@graph.graph: zeroLineColor must be one of ' strjoin(valid_shadeColor)]);
valid_legend_locations = ... valid_legend_locations = ...
{'south west','south east','north west','north east','outer north east'}; {'south west','south east','north west','north east','outer north east'};

View File

@ -212,7 +212,8 @@ if ~isempty(o.shade)
end end
if o.showZeroline if o.showZeroline
fprintf(fid, '%%zeroline\n\\addplot[black,line width=.5,forget plot] coordinates {(1,0)(%d,0)};\n',dd.ndat); fprintf(fid, '%%zeroline\n\\addplot[%s,line width=.5,forget plot] coordinates {(1,0)(%d,0)};\n', ...
o.zeroLineColor, dd.ndat);
end end
for i=1:ne for i=1:ne

View File

@ -65,8 +65,9 @@ r = report();
r = r.addSection('cols', 2); r = r.addSection('cols', 2);
@# for var in endovars @# for var in endovars
r = r.addGraph('data', shock@{shock}.@{var}, 'title', '@{var}', ... r = r.addGraph('data', shock@{shock}.@{var}, 'title', '@{var}', ...
'showGrid', false, 'yTickLabelPrecision', 2, 'yTickLabelZeroFill', false); 'showGrid', false, 'yTickLabelPrecision', 2, ...
r = r.addSeries('graphHline', 0, 'graphLineColor', 'red'); 'yTickLabelZeroFill', false, ...
'showZeroLine', true, 'zeroLineColor', 'red');
@# endfor @# endfor
r = r.addVspace('number', 2); r = r.addVspace('number', 2);
r = r.addSection('cols', 1); r = r.addSection('cols', 1);