Commit 1da03c6c authored by Houtan Bastani's avatar Houtan Bastani
Browse files

use predefined pgf layers

parent d242c924
...@@ -15,7 +15,7 @@ function o = writeGraphFile(o, pg, sec, row, col) ...@@ -15,7 +15,7 @@ function o = writeGraphFile(o, pg, sec, row, col)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2013-2014 Dynare Team % Copyright (C) 2013-2015 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -61,7 +61,7 @@ else ...@@ -61,7 +61,7 @@ else
dd = o.xrange; dd = o.xrange;
end end
fprintf(fid, '\\begin{axis}[%%\n'); fprintf(fid, '\\begin{axis}[%%\nset layers,');
% set tick labels % set tick labels
if isempty(o.xTickLabels) if isempty(o.xTickLabels)
stringsdd = strings(dd); stringsdd = strings(dd);
...@@ -212,18 +212,18 @@ if ~isempty(o.shade) ...@@ -212,18 +212,18 @@ if ~isempty(o.shade)
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
fprintf(fid,['\\begin{pgfonlayer}{background0}\n\\fill[%s!%f]\n(axis ' ... fprintf(fid,['\\begin{pgfonlayer}{axis background}\n\\fill[%s!%f]\n(axis ' ...
'cs:\\pgfkeysvalueof{/pgfplots/xmin},\\pgfkeysvalueof{/pgfplots/ymin})\nrectangle (axis ' ... 'cs:\\pgfkeysvalueof{/pgfplots/xmin},\\pgfkeysvalueof{/pgfplots/ymin})\nrectangle (axis ' ...
'cs:%f,\\pgfkeysvalueof{/pgfplots/ymax});\n\\end{pgfonlayer}\n'], ... 'cs:%f,\\pgfkeysvalueof{/pgfplots/ymax});\n\\end{pgfonlayer}\n'], ...
o.shadeColor, o.shadeOpacity, x2); o.shadeColor, o.shadeOpacity, x2);
elseif x2 == dd.ndat elseif x2 == dd.ndat
fprintf(fid,['\\begin{pgfonlayer}{background0}\n\\fill[%s!%f]\n(axis ' ... fprintf(fid,['\\begin{pgfonlayer}{axis background}\n\\fill[%s!%f]\n(axis ' ...
'cs:%f,\\pgfkeysvalueof{/pgfplots/ymin})\nrectangle (axis ' ... 'cs:%f,\\pgfkeysvalueof{/pgfplots/ymin})\nrectangle (axis ' ...
'cs:\\pgfkeysvalueof{/pgfplots/xmax},\\pgfkeysvalueof{/' ... 'cs:\\pgfkeysvalueof{/pgfplots/xmax},\\pgfkeysvalueof{/' ...
'pgfplots/ymax});\n\\end{pgfonlayer}\n'], ... 'pgfplots/ymax});\n\\end{pgfonlayer}\n'], ...
o.shadeColor, o.shadeOpacity, x1); o.shadeColor, o.shadeOpacity, x1);
else else
fprintf(fid,['\\begin{pgfonlayer}{background0}\n\\fill[%s!%f]\n(axis ' ... fprintf(fid,['\\begin{pgfonlayer}{axis background}\n\\fill[%s!%f]\n(axis ' ...
'cs:%f,\\pgfkeysvalueof{/pgfplots/ymin})\nrectangle (axis ' ... 'cs:%f,\\pgfkeysvalueof{/pgfplots/ymin})\nrectangle (axis ' ...
'cs:%f,\\pgfkeysvalueof{/pgfplots/ymax});\n\\end{pgfonlayer}\n'], ... 'cs:%f,\\pgfkeysvalueof{/pgfplots/ymax});\n\\end{pgfonlayer}\n'], ...
o.shadeColor, o.shadeOpacity, x1, x2); o.shadeColor, o.shadeOpacity, x1, x2);
......
...@@ -11,7 +11,7 @@ function o = write(o) ...@@ -11,7 +11,7 @@ function o = write(o)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2013-2014 Dynare Team % Copyright (C) 2013-2015 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -72,9 +72,6 @@ fprintf(fid, '\\setlength{\\parindent}{0in}\n'); ...@@ -72,9 +72,6 @@ fprintf(fid, '\\setlength{\\parindent}{0in}\n');
fprintf(fid, '\\setlength{\\tabcolsep}{1em}\n'); fprintf(fid, '\\setlength{\\tabcolsep}{1em}\n');
fprintf(fid, '\\newlength\\sectionheight\n'); fprintf(fid, '\\newlength\\sectionheight\n');
fprintf(fid, '\\begin{document}\n'); fprintf(fid, '\\begin{document}\n');
fprintf(fid, '\\pgfdeclarelayer{background0}\n');
fprintf(fid, '\\pgfdeclarelayer{background1}\n');
fprintf(fid, '\\pgfsetlayers{background0,background1,main}\n');
fprintf(fid, '\\pgfplotsset{tick scale binop={\\times},\ntrim axis left}\n'); fprintf(fid, '\\pgfplotsset{tick scale binop={\\times},\ntrim axis left}\n');
fprintf(fid, '\\centering\n'); fprintf(fid, '\\centering\n');
......
...@@ -12,7 +12,7 @@ function o = writeSeriesForGraph(o, fid, xrange) ...@@ -12,7 +12,7 @@ function o = writeSeriesForGraph(o, fid, xrange)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2014 Dynare Team % Copyright (C) 2014-2015 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -82,7 +82,7 @@ assert(isfloat(o.zeroTol), '@report_series.write: zeroTol must be a float'); ...@@ -82,7 +82,7 @@ assert(isfloat(o.zeroTol), '@report_series.write: zeroTol must be a float');
%% graphVline && graphHline %% graphVline && graphHline
if ~isempty(o.graphVline) if ~isempty(o.graphVline)
fprintf(fid, '%%Vertical Line\n\\begin{pgfonlayer}{background1}\n\\draw'); fprintf(fid, '%%Vertical Line\n\\begin{pgfonlayer}{axis lines}\n\\draw');
writeLineOptions(o, fid); writeLineOptions(o, fid);
stringsdd = strings(xrange); stringsdd = strings(xrange);
x = find(strcmpi(date2string(o.graphVline), stringsdd)); x = find(strcmpi(date2string(o.graphVline), stringsdd));
...@@ -91,7 +91,7 @@ if ~isempty(o.graphVline) ...@@ -91,7 +91,7 @@ if ~isempty(o.graphVline)
x, x); x, x);
end end
if ~isempty(o.graphHline) if ~isempty(o.graphHline)
fprintf(fid, '%%Horizontal Line\n\\begin{pgfonlayer}{background1}\n\\addplot'); fprintf(fid, '%%Horizontal Line\n\\begin{pgfonlayer}{axis lines}\n\\addplot');
writeLineOptions(o, fid); writeLineOptions(o, fid);
fprintf(fid, ['coordinates {(\\pgfkeysvalueof{/pgfplots/xmin},%f)' ... fprintf(fid, ['coordinates {(\\pgfkeysvalueof{/pgfplots/xmin},%f)' ...
'(\\pgfkeysvalueof{/pgfplots/xmax},%f)};\n\\end{pgfonlayer}\n'], ... '(\\pgfkeysvalueof{/pgfplots/xmax},%f)};\n\\end{pgfonlayer}\n'], ...
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment