diff --git a/doc/dynare.texi b/doc/dynare.texi index d577e2ed9a90b34b0a503f5d90bb678759d2c064..19dabf24af0a0ff7513dee5c71bdb9aafa43f33a 100644 --- a/doc/dynare.texi +++ b/doc/dynare.texi @@ -11332,7 +11332,7 @@ Whether or not to show vertical lines separating the columns. Default: @code{fal @end defmethod @anchor{addSeries} -@defmethod Report addSeries data, graphLegendName, graphLineColor, graphLineStyle, graphLineWidth, graphMarker, graphMarkerEdgeColor, graphMarkerFaceColor, graphMarkerSize, tableDataRhs, tableRowColor, tableRowIndent, tableShowMarkers, tableAlignRight, tableNegColor, tablePosColor, tableSubSectionHeader, zeroTol +@defmethod Report addSeries data, graphLegendName, graphLineColor, graphLineStyle, graphLineWidth, graphMarker, graphMarkerEdgeColor, graphMarkerFaceColor, graphMarkerSize, graphMiscTikzAddPlotOptions, tableDataRhs, tableRowColor, tableRowIndent, tableShowMarkers, tableAlignRight, tableNegColor, tablePosColor, tableSubSectionHeader, zeroTol Adds a @code{Series} to a @code{Graph} or a @code{Table}. @optionshead @table @code @@ -11365,6 +11365,15 @@ The face color of the graph marker. Default: @code{graphLineColor} @item graphMarkerSize, @code{DOUBLE} The size of the graph marker. Default: @code{1} +@item graphMiscTikzAddPlotOptions, @code{STRING} +If you are comfortable with PGFPLOTS/Ti@i{k}Z, you can use this option to pass +arguments directly to the PGFPLOTS/Ti@i{k}Z @code{addPlots} command. (@i{e.g.,} +Instead of passing the marker options above, you can pass a string such as the +following to this option: @code{`mark=halfcircle*,mark +options={rotate=90,scale=3}'}). Specifically to be used for desired +PGFPLOTS/Ti@i{k}Z options that have not been incorporated into Dynare +Reproting. Default: @code{empty} + @item tableDataRhs, @code{dseries} A series to be added to the right of the current series. Usefull for displaying aggregate data for a series. @i{e.g} if the series is diff --git a/matlab/reports/@report_series/report_series.m b/matlab/reports/@report_series/report_series.m index 4adf75409e83b875ae234ccf57a6739f76b25e52..4d3e6287ac64dbd517d6597a31b68b85375924e4 100644 --- a/matlab/reports/@report_series/report_series.m +++ b/matlab/reports/@report_series/report_series.m @@ -46,6 +46,8 @@ o.graphMarkerEdgeColor = ''; o.graphMarkerFaceColor = ''; o.graphMarkerSize = 1; +o.graphMiscTikzAddPlotOptions = ''; + o.tableShowMarkers = false; o.tableNegColor = 'red'; o.tablePosColor = 'blue'; diff --git a/matlab/reports/@report_series/writeSeriesForGraph.m b/matlab/reports/@report_series/writeSeriesForGraph.m index 45f98f507f412fe0defd9f3ab9735517cfcd4291..ac5e2dee271f09c26568e2f0da9ada8a428fe536 100644 --- a/matlab/reports/@report_series/writeSeriesForGraph.m +++ b/matlab/reports/@report_series/writeSeriesForGraph.m @@ -33,6 +33,9 @@ function o = writeSeriesForGraph(o, fid, xrange) assert(~isempty(o.data) && isa(o.data, 'dseries'), ['@report_series.writeSeriesForGraph: must ' ... 'provide data as a dseries']); +assert(ischar(o.graphMiscTikzAddPlotOptions), ['@report_series.writeSeriesForGraph: ' ... + 'graphMiscTikzAddPlotOptions file must be a string']); + % Line valid_graphLineColor = {'red', 'green', 'blue', 'cyan ', 'magenta', 'yellow', ... 'black', 'gray', 'darkgray', 'lightgray', 'brown', ... @@ -96,6 +99,9 @@ if ~isempty(o.graphMarker) fprintf(fid, ',mark=%s,mark size=%f,every mark/.append style={draw=%s,fill=%s}',... o.graphMarker,o.graphMarkerSize,o.graphMarkerEdgeColor,o.graphMarkerFaceColor); end +if ~isempty(o.graphMiscTikzAddPlotOptions) + fprintf(fid, ',%s', o.graphMiscTikzAddPlotOptions) +end fprintf(fid,']\ntable[row sep=crcr]{\nx y\\\\\n'); for i=1:ds.dates.ndat fprintf(fid, '%d %f\\\\\n', i, thedata(i)); diff --git a/tests/reporting/runDynareReport.m b/tests/reporting/runDynareReport.m index afdff04472c04fe9eaec01e22f5a727d6b1b2fb3..9c6f66ed9854b5c66f1048b0b60991c7f305db6c 100644 --- a/tests/reporting/runDynareReport.m +++ b/tests/reporting/runDynareReport.m @@ -240,12 +240,14 @@ rep = rep.addGraph('title', 'Equilibrium World Real Food Price', ... rep = rep.addSeries('data', db_q{'LRPFOOD_BAR_WORLD'}, ... 'graphLineColor', 'blue', ... 'graphLineWidth', 1.5, ... - 'graphLegendName', 'baseline'); + 'graphLegendName', 'baseline', ... + 'graphMiscTikzAddPlotOptions', 'mark=halfcircle*,color=red'); rep = rep.addSeries('data', dc_q{'LRPFOOD_BAR_WORLD'}, ... 'graphLineColor', 'blue', ... 'graphLineStyle', 'dashed', ... 'graphLineWidth', 1.5, ... - 'graphLegendName', 'control'); + 'graphLegendName', 'control', ... + 'graphMiscTikzAddPlotOptions', 'mark=halfcircle*,mark options={rotate=90,scale=3}'); %% Write & Compile Report rep.write();