diff --git a/doc/dynare.texi b/doc/dynare.texi index 9f922f77b4c00cf3e99cca34c4bcc7d22ea0944c..6a286121895c52f068e20234b8623ae9d2550686 100644 --- a/doc/dynare.texi +++ b/doc/dynare.texi @@ -11239,7 +11239,7 @@ command. Default: @code{`!'} @end defmethod @anchor{addGraph} -@defmethod Report addGraph axisShape, data, graphDirName, graphName, graphSize, height, showGrid, showLegend, showLegendBox, legendLocation, legendOrientation, legendFontSize, miscTikzAxisOptions, miscTikzPictureOptions, seriesToUse, shade, shadeColor, shadeOpacity, title, titleFormat, width, xlabel, ylabel, xAxisTight, xrange, xTicks, xTickLabels, xTickLabelAnchor, xTickLabelRotation, yAxisTight, yTickLabelFixed, yTickLabelPrecision, yTickLabelZeroFill, yrange, showZeroline, zeroLineColor +@defmethod Report addGraph axisShape, data, graphDirName, graphName, graphSize, height, showGrid, showLegend, showLegendBox, legendLocation, legendOrientation, legendFontSize, miscTikzAxisOptions, miscTikzPictureOptions, seriesToUse, shade, shadeColor, shadeOpacity, title, titleFontSize, titleFormat, width, xlabel, ylabel, xAxisTight, xrange, xTicks, xTickLabels, xTickLabelAnchor, xTickLabelRotation, yAxisTight, yTickLabelFixed, yTickLabelPrecision, yTickLabelZeroFill, yrange, showZeroline, zeroLineColor Adds a @code{Graph} to a @code{Section}. @optionshead @table @code @@ -11335,6 +11335,9 @@ The opacity of the shaded area, must be in @math{[0,100]}. Default: @code{20} @item title, @code{STRING} | @code{CELL_ARRAY_STRINGS} Same as @ref{title}, just for graphs. +@item titleFontSize, @code{`tiny'} | @code{`scriptsize'} | @code{`footnotesize'} | @code{`small'} | @code{`normalsize'} | @code{`large'} | @code{`Large'} | @code{`LARGE'} | @code{`huge'} | @code{`Huge'} +The font size for title. Default: @code{normalsize} + @item titleFormat, @code{STRING} The format to use for @ref{graph.title,,the graph title}. Unlike @ref{titleFormat}, due to a constraint of TikZ, this format applies to diff --git a/matlab/reports/@graph/graph.m b/matlab/reports/@graph/graph.m index f6d9f65bc20c9d60ac19b04d0054d6fe6e198cec..7a789dcfc59b19b599947279804d5500b1a14008 100644 --- a/matlab/reports/@graph/graph.m +++ b/matlab/reports/@graph/graph.m @@ -37,6 +37,7 @@ o.series = {}; o.title = ''; o.titleFormat = ''; +o.titleFontSize = 'normalsize' o.ylabel = ''; o.xlabel = ''; @@ -149,10 +150,12 @@ valid_legend_locations = ... assert(any(strcmp(o.legendLocation, valid_legend_locations)), ... ['@graph.graph: legendLocation must be one of ' strjoin(valid_legend_locations, ' ')]); -valid_legend_font_sizes = {'tiny', 'scriptsize', 'footnotesize', 'small', ... +valid_font_sizes = {'tiny', 'scriptsize', 'footnotesize', 'small', ... 'normalsize', 'large', 'Large', 'LARGE', 'huge', 'Huge'}; -assert(any(strcmp(o.legendFontSize, valid_legend_font_sizes)), ... - ['@graph.graph: legendFontSize must be one of ' strjoin(valid_legend_font_sizes)]); +assert(any(strcmp(o.legendFontSize, valid_font_sizes)), ... + ['@graph.graph: legendFontSize must be one of ' strjoin(valid_font_sizes)]); +assert(any(strcmp(o.titleFontSize, valid_font_sizes)), ... + ['@graph.graph: titleFontSize must be one of ' strjoin(valid_font_sizes)]); valid_legend_orientations = {'vertical', 'horizontal'}; assert(any(strcmp(o.legendOrientation, valid_legend_orientations)), ... diff --git a/matlab/reports/@graph/writeGraphFile.m b/matlab/reports/@graph/writeGraphFile.m index 4832c7943ce06726add57be9a1556a288a3b3b4a..b6d6ae10d0a8add4ea588dd66e0b966ba499fe66 100644 --- a/matlab/reports/@graph/writeGraphFile.m +++ b/matlab/reports/@graph/writeGraphFile.m @@ -189,6 +189,10 @@ if ~isempty(o.miscTikzAxisOptions) end fprintf(fid, ']\n'); +if ~isempty(o.title{1}) + fprintf(fid, '\\tikzstyle{every axis title}=[font=\\%s]\n', o.titleFontSize); +end + if ~isempty(o.shade) fprintf(fid, '%%shading\n'); stringsdd = strings(dd);