From 6d71e53646423bbe13dff52900fe342a2392a609 Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Fri, 14 Feb 2014 15:33:28 +0100 Subject: [PATCH] reporting: include graph title in tikz code as opposed to latex --- matlab/reports/@graph/write.m | 9 --------- matlab/reports/@graph/writeGraphFile.m | 4 ++++ tests/reporting/runDynareReport.m | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/matlab/reports/@graph/write.m b/matlab/reports/@graph/write.m index 6aa3f4ab69..7fee076f3a 100644 --- a/matlab/reports/@graph/write.m +++ b/matlab/reports/@graph/write.m @@ -31,14 +31,5 @@ function o = write(o, fid) assert(fid ~= -1); o = writeGraphFile(o); - -if ~isempty(o.title) - fprintf(fid,'\\begin{tabular}[x]{@{}c@{}}%s\\\\',o.title); -end - fprintf(fid, '\\input{%s}', o.figname); - -if ~isempty(o.title) - fprintf(fid,'\\end{tabular}'); -end end \ No newline at end of file diff --git a/matlab/reports/@graph/writeGraphFile.m b/matlab/reports/@graph/writeGraphFile.m index 6cedee93f0..d130f8d613 100644 --- a/matlab/reports/@graph/writeGraphFile.m +++ b/matlab/reports/@graph/writeGraphFile.m @@ -88,6 +88,10 @@ fprintf(fid, ['},\n',... 'axis lines=box,\n'... 'unbounded coords=jump,\n'], o.width, o.height); +if ~isempty(o.title) + fprintf(fid, 'title=%s,\n', o.title); +end + if o.xAxisTight fprintf(fid, 'enlarge x limits=false,\n'); else diff --git a/tests/reporting/runDynareReport.m b/tests/reporting/runDynareReport.m index ef03704fc4..835b229f3e 100644 --- a/tests/reporting/runDynareReport.m +++ b/tests/reporting/runDynareReport.m @@ -146,7 +146,7 @@ rep = CommResidTablePage(rep, db_q, dc_q, trange, dates('2012q2')); %Page 1 rep = rep.addPage('title', 'Jan1 vs Jan2', ... 'titleFormat', '\large\bfseries'); -rep = rep.addSection('height', '60mm'); +rep = rep.addSection(); rep = rep.addGraph('title', 'World Real Oil Price Index', ... 'xrange', prange, ... -- GitLab