Skip to content
Snippets Groups Projects
Verified Commit 57a4d667 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Rename @graph class to @report_graph, to avoid name clash with MATLAB’s @graph

Closes: #17
parent 13c98b25
Branches
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ function o = addSeries(o, varargin) ...@@ -3,7 +3,7 @@ function o = addSeries(o, varargin)
% Add a series % Add a series
% %
% INPUTS % INPUTS
% o [graph] graph object % o [report_graph] report_graph object
% varargin arguments to report_series() % varargin arguments to report_series()
% %
% OUTPUTS % OUTPUTS
...@@ -12,7 +12,7 @@ function o = addSeries(o, varargin) ...@@ -12,7 +12,7 @@ function o = addSeries(o, varargin)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2013-2019 Dynare Team % Copyright (C) 2013-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -30,4 +30,4 @@ function o = addSeries(o, varargin) ...@@ -30,4 +30,4 @@ function o = addSeries(o, varargin)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
o.series{end+1} = report_series(varargin{:}); o.series{end+1} = report_series(varargin{:});
end end
\ No newline at end of file
...@@ -3,7 +3,7 @@ function lastIndex = end(o, k, n) ...@@ -3,7 +3,7 @@ function lastIndex = end(o, k, n)
% End keyword % End keyword
% %
% INPUTS % INPUTS
% o [graph] graph object % o [report_graph] report_graph object
% k [integer] index where end appears % k [integer] index where end appears
% n [integer] number of indices % n [integer] number of indices
% %
...@@ -13,7 +13,7 @@ function lastIndex = end(o, k, n) ...@@ -13,7 +13,7 @@ function lastIndex = end(o, k, n)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2013-2015 Dynare Team % Copyright (C) 2013-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -30,6 +30,6 @@ function lastIndex = end(o, k, n) ...@@ -30,6 +30,6 @@ function lastIndex = end(o, k, n)
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
assert(k==1 && n==1, '@graph/end: graph only has one dimension'); assert(k==1 && n==1, '@report_graph/end: graph only has one dimension');
lastIndex = length(o.series); lastIndex = length(o.series);
end end
\ No newline at end of file
classdef graph < handle classdef report_graph < handle
% graph Class % report_graph Class
% %
% Copyright (C) 2013-2019 Dynare Team % Copyright (C) 2013-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -63,31 +63,31 @@ classdef graph < handle ...@@ -63,31 +63,31 @@ classdef graph < handle
writeCSV = false % Whether or not to write a CSV file with only the plotted data. The file will be saved in the directory specified by graphDirName with the same base name as specified by graphName with the ending .csv. Default: false. writeCSV = false % Whether or not to write a CSV file with only the plotted data. The file will be saved in the directory specified by graphDirName with the same base name as specified by graphName with the ending .csv. Default: false.
end end
methods methods
function o = graph(varargin) function o = report_graph(varargin)
%function o = graph(varargin) %function o = report_graph(varargin)
% Graph Class Constructor % report_graph class constructor
% %
% INPUTS % INPUTS
% varargin 0 args : empty graph object % varargin 0 args : empty report_graph object
% 1 arg : must be graph object (return a copy of arg) % 1 arg : must be report_graph object (return a copy of arg)
% > 1 args: option/value pairs (see structure below for % > 1 args: option/value pairs (see structure below for
% options) % options)
% %
% OUTPUTS % OUTPUTS
% o [graph] graph object % o [report_graph] report_graph object
% %
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
if nargin == 0 if nargin == 0
return return
elseif nargin == 1 elseif nargin == 1
assert(isa(varargin{1}, 'graph'), ... assert(isa(varargin{1}, 'report_graph'), ...
'With one arg to the Graph constructor, you must pass a graph object'); 'With one arg to the report_graph constructor, you must pass a report_graph object');
o = varargin{1}; o = varargin{1};
return return
elseif nargin > 1 elseif nargin > 1
if round(nargin/2) ~= nargin/2 if round(nargin/2) ~= nargin/2
error('@graph.graph: options must be supplied in name/value pairs.'); error('@report_graph.report_graph: options must be supplied in name/value pairs.');
end end
% Octave 5.1.0 has not implemented `properties` and issues a warning when using `fieldnames` % Octave 5.1.0 has not implemented `properties` and issues a warning when using `fieldnames`
...@@ -102,7 +102,7 @@ classdef graph < handle ...@@ -102,7 +102,7 @@ classdef graph < handle
if ~isempty(ind) if ~isempty(ind)
o.(optNames{ind}) = pair{2}; o.(optNames{ind}) = pair{2};
else else
error('@graph.graph: %s is not a recognized option.', pair{1}); error('@report_graph.report_graph: %s is not a recognized option.', pair{1});
end end
end end
end end
...@@ -111,82 +111,82 @@ classdef graph < handle ...@@ -111,82 +111,82 @@ classdef graph < handle
if ischar(o.title) if ischar(o.title)
o.title = {o.title}; o.title = {o.title};
end end
assert(iscellstr(o.title), '@graph.graph: title must be a cell array of string(s)'); assert(iscellstr(o.title), '@report_graph.report_graph: title must be a cell array of string(s)');
assert(ischar(o.titleFormat), '@graph.graph: titleFormat file must be a string'); assert(ischar(o.titleFormat), '@report_graph.report_graph: titleFormat file must be a string');
assert(ischar(o.xlabel), '@graph.graph: xlabel file must be a string'); assert(ischar(o.xlabel), '@report_graph.report_graph: xlabel file must be a string');
assert(ischar(o.ylabel), '@graph.graph: ylabel file must be a string'); assert(ischar(o.ylabel), '@report_graph.report_graph: ylabel file must be a string');
assert(ischar(o.miscTikzPictureOptions), '@graph.graph: miscTikzPictureOptions file must be a string'); assert(ischar(o.miscTikzPictureOptions), '@report_graph.report_graph: miscTikzPictureOptions file must be a string');
assert(ischar(o.miscTikzAxisOptions), '@graph.graph: miscTikzAxisOptions file must be a string'); assert(ischar(o.miscTikzAxisOptions), '@report_graph.report_graph: miscTikzAxisOptions file must be a string');
assert(ischar(o.graphName), '@graph.graph: graphName must be a string'); assert(ischar(o.graphName), '@report_graph.report_graph: graphName must be a string');
assert(ischar(o.graphDirName), '@graph.graph: graphDirName must be a string'); assert(ischar(o.graphDirName), '@report_graph.report_graph: graphDirName must be a string');
assert(islogical(o.showGrid), '@graph.graph: showGrid must be either true or false'); assert(islogical(o.showGrid), '@report_graph.report_graph: showGrid must be either true or false');
assert(islogical(o.xAxisTight), '@graph.graph: xAxisTight must be either true or false'); assert(islogical(o.xAxisTight), '@report_graph.report_graph: xAxisTight must be either true or false');
assert(islogical(o.yAxisTight), '@graph.graph: yAxisTight must be either true or false'); assert(islogical(o.yAxisTight), '@report_graph.report_graph: yAxisTight must be either true or false');
assert(islogical(o.showLegend), '@graph.graph: showLegend must be either true or false'); assert(islogical(o.showLegend), '@report_graph.report_graph: showLegend must be either true or false');
assert(isempty(o.legendAt) || (isfloat(o.legendAt) && length(o.legendAt)==2), ... assert(isempty(o.legendAt) || (isfloat(o.legendAt) && length(o.legendAt)==2), ...
'@graph.graph: legendAt must be a double array of size two'); '@report_graph.report_graph: legendAt must be a double array of size two');
assert(islogical(o.showLegendBox), '@graph.graph: showLegendBox must be either true or false'); assert(islogical(o.showLegendBox), '@report_graph.report_graph: showLegendBox must be either true or false');
assert(islogical(o.showZeroline), '@graph.graph: showZeroline must be either true or false'); assert(islogical(o.showZeroline), '@report_graph.report_graph: showZeroline must be either true or false');
assert(isfloat(o.shadeOpacity) && length(o.shadeOpacity)==1 && ... assert(isfloat(o.shadeOpacity) && length(o.shadeOpacity)==1 && ...
o.shadeOpacity >= 0 && o.shadeOpacity <= 100, ... o.shadeOpacity >= 0 && o.shadeOpacity <= 100, ...
'@graph.graph: o.shadeOpacity must be a real in [0 100]'); '@report_graph.report_graph: o.shadeOpacity must be a real in [0 100]');
assert(isfloat(o.width), '@graph.graph: o.width must be a real number'); assert(isfloat(o.width), '@report_graph.report_graph: o.width must be a real number');
assert(isfloat(o.height), '@graph.graph: o.height must be a real number'); assert(isfloat(o.height), '@report_graph.report_graph: o.height must be a real number');
assert(isfloat(o.xTickLabelRotation), '@graph.graph: o.xTickLabelRotation must be a real number'); assert(isfloat(o.xTickLabelRotation), '@report_graph.report_graph: o.xTickLabelRotation must be a real number');
assert(ischar(o.xTickLabelAnchor), '@graph.graph: xTickLabelAnchor must be a string'); assert(ischar(o.xTickLabelAnchor), '@report_graph.report_graph: xTickLabelAnchor must be a string');
assert(isint(o.yTickLabelPrecision), '@graph.graph: o.yTickLabelPrecision must be an integer'); assert(isint(o.yTickLabelPrecision), '@report_graph.report_graph: o.yTickLabelPrecision must be an integer');
assert(islogical(o.yTickLabelFixed), '@graph.graph: yTickLabelFixed must be either true or false'); assert(islogical(o.yTickLabelFixed), '@report_graph.report_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), '@report_graph.report_graph: yTickLabelZeroFill must be either true or false');
assert(islogical(o.yTickLabelScaled), '@graph.graph: yTickLabelScaled must be either true or false'); assert(islogical(o.yTickLabelScaled), '@report_graph.report_graph: yTickLabelScaled must be either true or false');
assert(islogical(o.writeCSV), '@graph.graph: writeCSV must be either true or false'); assert(islogical(o.writeCSV), '@report_graph.report_graph: writeCSV must be either true or false');
assert(ischar(o.shadeColor), '@graph.graph: shadeColor must be a string'); assert(ischar(o.shadeColor), '@report_graph.report_graph: shadeColor must be a string');
assert(ischar(o.zeroLineColor), '@graph.graph: zeroLineColor must be a string'); assert(ischar(o.zeroLineColor), '@report_graph.report_graph: zeroLineColor must be a string');
assert(any(strcmp(o.axisShape, {'box', 'L'})), ['@graph.graph: axisShape ' ... assert(any(strcmp(o.axisShape, {'box', 'L'})), ['@report_graph.report_graph: axisShape ' ...
'must be one of ''box'' or ''L''']); 'must be one of ''box'' or ''L''']);
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'};
assert(any(strcmp(o.legendLocation, valid_legend_locations)), ... assert(any(strcmp(o.legendLocation, valid_legend_locations)), ...
['@graph.graph: legendLocation must be one of ' addCommasToCellStr(valid_legend_locations)]); ['@report_graph.report_graph: legendLocation must be one of ' addCommasToCellStr(valid_legend_locations)]);
valid_font_sizes = {'tiny', 'scriptsize', 'footnotesize', 'small', ... valid_font_sizes = {'tiny', 'scriptsize', 'footnotesize', 'small', ...
'normalsize', 'large', 'Large', 'LARGE', 'huge', 'Huge'}; 'normalsize', 'large', 'Large', 'LARGE', 'huge', 'Huge'};
assert(any(strcmp(o.legendFontSize, valid_font_sizes)), ... assert(any(strcmp(o.legendFontSize, valid_font_sizes)), ...
['@graph.graph: legendFontSize must be one of ' addCommasToCellStr(valid_font_sizes)]); ['@report_graph.report_graph: legendFontSize must be one of ' addCommasToCellStr(valid_font_sizes)]);
assert(any(strcmp(o.titleFontSize, valid_font_sizes)), ... assert(any(strcmp(o.titleFontSize, valid_font_sizes)), ...
['@graph.graph: titleFontSize must be one of ' addCommasToCellStr(valid_font_sizes)]); ['@report_graph.report_graph: titleFontSize must be one of ' addCommasToCellStr(valid_font_sizes)]);
assert(any(strcmp(o.tickFontSize, valid_font_sizes)), ... assert(any(strcmp(o.tickFontSize, valid_font_sizes)), ...
['@graph.graph: tickFontSize must be one of ' addCommasToCellStr(valid_font_sizes)]); ['@report_graph.report_graph: tickFontSize must be one of ' addCommasToCellStr(valid_font_sizes)]);
valid_legend_orientations = {'vertical', 'horizontal'}; valid_legend_orientations = {'vertical', 'horizontal'};
assert(any(strcmp(o.legendOrientation, valid_legend_orientations)), ... assert(any(strcmp(o.legendOrientation, valid_legend_orientations)), ...
['@graph.graph: legendOrientation must be one of ' addCommasToCellStr(valid_legend_orientations)]); ['@report_graph.report_graph: legendOrientation must be one of ' addCommasToCellStr(valid_legend_orientations)]);
assert(isempty(o.shade) || (isdates(o.shade) && o.shade.ndat >= 2), ... assert(isempty(o.shade) || (isdates(o.shade) && o.shade.ndat >= 2), ...
['@graph.graph: shade is specified as a dates range, e.g. ' ... ['@report_graph.report_graph: shade is specified as a dates range, e.g. ' ...
'''dates(''1999q1''):dates(''1999q3'')''.']); '''dates(''1999q1''):dates(''1999q3'')''.']);
assert(isempty(o.xrange) || (isdates(o.xrange) && o.xrange.ndat >= 2), ... assert(isempty(o.xrange) || (isdates(o.xrange) && o.xrange.ndat >= 2), ...
['@graph.graph: xrange is specified as a dates range, e.g. ' ... ['@report_graph.report_graph: xrange is specified as a dates range, e.g. ' ...
'''dates(''1999q1''):dates(''1999q3'')''.']); '''dates(''1999q1''):dates(''1999q3'')''.']);
assert(isempty(o.yrange) || (isfloat(o.yrange) && length(o.yrange) == 2 && ... assert(isempty(o.yrange) || (isfloat(o.yrange) && length(o.yrange) == 2 && ...
o.yrange(1) < o.yrange(2)), ... o.yrange(1) < o.yrange(2)), ...
['@graph.graph: yrange is specified an array with two float entries, ' ... ['@report_graph.report_graph: yrange is specified an array with two float entries, ' ...
'the lower bound and upper bound.']); 'the lower bound and upper bound.']);
assert(isempty(o.data) || isdseries(o.data), ['@graph.graph: data must ' ... assert(isempty(o.data) || isdseries(o.data), ['@report_graph.report_graph: data must ' ...
'be a dseries']); 'be a dseries']);
assert(isempty(o.seriesToUse) || iscellstr(o.seriesToUse), ['@graph.graph: ' ... assert(isempty(o.seriesToUse) || iscellstr(o.seriesToUse), ['@report_graph.report_graph: ' ...
'seriesToUse must be a cell array of string(s)']); 'seriesToUse must be a cell array of string(s)']);
assert(isempty(o.xTicks) || isfloat(o.xTicks),... assert(isempty(o.xTicks) || isfloat(o.xTicks),...
'@graph.graph: xTicks must be a numerical array'); '@report_graph.report_graph: xTicks must be a numerical array');
assert(iscellstr(o.xTickLabels) || (ischar(o.xTickLabels) && strcmpi(o.xTickLabels, 'ALL')), ... assert(iscellstr(o.xTickLabels) || (ischar(o.xTickLabels) && strcmpi(o.xTickLabels, 'ALL')), ...
['@graph.graph: xTickLabels must be a cell array of strings or ' ... ['@report_graph.report_graph: xTickLabels must be a cell array of strings or ' ...
'equivalent to the string ''ALL''']); 'equivalent to the string ''ALL''']);
if ~isempty(o.xTickLabels) if ~isempty(o.xTickLabels)
assert((ischar(o.xTickLabels) && strcmpi(o.xTickLabels, 'ALL')) || ... assert((ischar(o.xTickLabels) && strcmpi(o.xTickLabels, 'ALL')) || ...
~isempty(o.xTicks), ['@graph.graph: if you set xTickLabels and ' ... ~isempty(o.xTicks), ['@report_graph.report_graph: if you set xTickLabels and ' ...
'it''s not equal to ''ALL'', you must set xTicks']); 'it''s not equal to ''ALL'', you must set xTicks']);
end end
if ~isempty(o.xTicks) if ~isempty(o.xTicks)
assert(~isempty(o.xTickLabels), '@graph.graph: if you set xTicks, you must set xTickLabels'); assert(~isempty(o.xTickLabels), '@report_graph.report_graph: if you set xTicks, you must set xTickLabels');
end end
% using o.seriesToUse, create series objects and put them in o.series % using o.seriesToUse, create series objects and put them in o.series
......
function write(o, fid, pg, sec, row, col, rep_dir) function write(o, fid, pg, sec, row, col, rep_dir)
%function write(o, fid, pg, sec, row, col, rep_dir) %function write(o, fid, pg, sec, row, col, rep_dir)
% Write a Graph object % Write a report_graph object
% %
% INPUTS % INPUTS
% o [graph] graph object % o [report_graph] report_graph object
% fid [integer] file id % fid [integer] file id
% pg [integer] this page number % pg [integer] this page number
% sec [integer] this section number % sec [integer] this section number
...@@ -12,12 +12,12 @@ function write(o, fid, pg, sec, row, col, rep_dir) ...@@ -12,12 +12,12 @@ function write(o, fid, pg, sec, row, col, rep_dir)
% rep_dir [string] directory containing report.tex % rep_dir [string] directory containing report.tex
% %
% OUTPUTS % OUTPUTS
% o [graph] graph object % o [report_graph] report_graph object
% %
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2013-2019 Dynare Team % Copyright (C) 2013-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -36,4 +36,4 @@ function write(o, fid, pg, sec, row, col, rep_dir) ...@@ -36,4 +36,4 @@ function write(o, fid, pg, sec, row, col, rep_dir)
graphName = writeGraphFile(o, pg, sec, row, col, rep_dir); graphName = writeGraphFile(o, pg, sec, row, col, rep_dir);
fprintf(fid, '\\input{%s}', graphName); fprintf(fid, '\\input{%s}', graphName);
end end
\ No newline at end of file
...@@ -3,7 +3,7 @@ function graphName = writeGraphFile(o, pg, sec, row, col, rep_dir) ...@@ -3,7 +3,7 @@ function graphName = writeGraphFile(o, pg, sec, row, col, rep_dir)
% Write the tikz file that contains the graph % Write the tikz file that contains the graph
% %
% INPUTS % INPUTS
% o [graph] graph object % o [report_graph] report_graph object
% pg [integer] this page number % pg [integer] this page number
% sec [integer] this section number % sec [integer] this section number
% row [integer] this row number % row [integer] this row number
...@@ -16,7 +16,7 @@ function graphName = writeGraphFile(o, pg, sec, row, col, rep_dir) ...@@ -16,7 +16,7 @@ function graphName = writeGraphFile(o, pg, sec, row, col, rep_dir)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2013-2019 Dynare Team % Copyright (C) 2013-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -35,7 +35,7 @@ function graphName = writeGraphFile(o, pg, sec, row, col, rep_dir) ...@@ -35,7 +35,7 @@ function graphName = writeGraphFile(o, pg, sec, row, col, rep_dir)
ne = length(o.series); ne = length(o.series);
if ne < 1 if ne < 1
warning('@graph.writeGraphFile: no series to plot, returning'); warning('@report_graph.writeGraphFile: no series to plot, returning');
return return
end end
...@@ -50,7 +50,7 @@ end ...@@ -50,7 +50,7 @@ end
[fid, msg] = fopen([rep_dir '/' graphName], 'w'); [fid, msg] = fopen([rep_dir '/' graphName], 'w');
if fid == -1 if fid == -1
error(['@graph.writeGraphFile: ' msg]); error(['@report_graph.writeGraphFile: ' msg]);
end end
fprintf(fid, '%% Graph Object written %s\n', datestr(now)); fprintf(fid, '%% Graph Object written %s\n', datestr(now));
...@@ -227,7 +227,7 @@ if ~isempty(o.shade) ...@@ -227,7 +227,7 @@ if ~isempty(o.shade)
stringsdd = strings(dd); stringsdd = strings(dd);
x1 = find(strcmpi(date2string(o.shade(1)), stringsdd)); x1 = find(strcmpi(date2string(o.shade(1)), stringsdd));
x2 = find(strcmpi(date2string(o.shade(end)), stringsdd)); x2 = find(strcmpi(date2string(o.shade(end)), stringsdd));
assert(~isempty(x1) && ~isempty(x2), ['@graph.writeGraphFile: either ' ... assert(~isempty(x1) && ~isempty(x2), ['@report_graph.writeGraphFile: either ' ...
date2string(o.shade(1)) ' or ' date2string(o.shade(end)) ' is not in the date ' ... date2string(o.shade(1)) ' or ' date2string(o.shade(end)) ' is not in the date ' ...
'range of data selected.']); 'range of data selected.']);
if x1 == 1 if x1 == 1
...@@ -329,6 +329,6 @@ if o.writeCSV ...@@ -329,6 +329,6 @@ if o.writeCSV
end end
fprintf(fid, '\\end{axis}\n\\end{tikzpicture}%%'); fprintf(fid, '\\end{axis}\n\\end{tikzpicture}%%');
if fclose(fid) == -1 if fclose(fid) == -1
error('@graph.writeGraphFile: closing %s\n', o.filename); error('@report_graph.writeGraphFile: closing %s\n', o.filename);
end end
end end
...@@ -4,7 +4,7 @@ function o = addGraph(o, varargin) ...@@ -4,7 +4,7 @@ function o = addGraph(o, varargin)
% %
% INPUTS % INPUTS
% o [section] section object % o [section] section object
% varargin arguments to graph() % varargin arguments to report_graph()
% %
% OUTPUTS % OUTPUTS
% updated section object % updated section object
...@@ -12,7 +12,7 @@ function o = addGraph(o, varargin) ...@@ -12,7 +12,7 @@ function o = addGraph(o, varargin)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2013-2019 Dynare Team % Copyright (C) 2013-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -33,5 +33,5 @@ if ~isempty(o.elements) ...@@ -33,5 +33,5 @@ if ~isempty(o.elements)
assert(~isa(o.elements{1}, 'paragraph'), ... assert(~isa(o.elements{1}, 'paragraph'), ...
'@section.addSeries: A section that contains a paragraph cannot contain a graph or a table'); '@section.addSeries: A section that contains a paragraph cannot contain a graph or a table');
end end
o.elements{end+1} = graph(varargin{:}); o.elements{end+1} = report_graph(varargin{:});
end end
...@@ -12,7 +12,7 @@ function o = addSeries(o, varargin) ...@@ -12,7 +12,7 @@ function o = addSeries(o, varargin)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2013-2019 Dynare Team % Copyright (C) 2013-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -33,7 +33,7 @@ assert(~isempty(o.elements), ... ...@@ -33,7 +33,7 @@ assert(~isempty(o.elements), ...
'@section.addSeries: Before adding a series, you must add either a graph or a table'); '@section.addSeries: Before adding a series, you must add either a graph or a table');
assert(~isa(o.elements{1}, 'paragraph'), ... assert(~isa(o.elements{1}, 'paragraph'), ...
'@section.addSeries: A section that contains a paragraph cannot contain a graph or a table'); '@section.addSeries: A section that contains a paragraph cannot contain a graph or a table');
assert(isa(o.elements{end}, 'graph') || isa(o.elements{end}, 'report_table'), ... assert(isa(o.elements{end}, 'report_graph') || isa(o.elements{end}, 'report_table'), ...
'@report.addSeries: you can only add a series to a report_table or graph object'); '@report.addSeries: you can only add a series to a report_table or report_graph object');
o.elements{end}.addSeries(varargin{:}); o.elements{end}.addSeries(varargin{:});
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment