reporting: fix shading
parent
f035fabb14
commit
bb3e2fdff8
|
@ -185,11 +185,23 @@ if ~isempty(o.shade)
|
||||||
assert(~isempty(x1) && ~isempty(x2), ['@graph.writeGraphFile: either ' ...
|
assert(~isempty(x1) && ~isempty(x2), ['@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.']);
|
||||||
fprintf(fid,['\\begin{pgfonlayer}{background}\n\\fill[%s!%f]\n(axis ' ...
|
if x1 == 1
|
||||||
'cs:%f,\\pgfkeysvalueof{/pgfplots/ymin})\nrectangle (axis ' ...
|
fprintf(fid,['\\begin{pgfonlayer}{background}\n\\fill[%s!%f]\n(axis ' ...
|
||||||
'cs:\\pgfkeysvalueof{/pgfplots/xmax},\\pgfkeysvalueof{/' ...
|
'cs:\\pgfkeysvalueof{/pgfplots/xmin},\\pgfkeysvalueof{/pgfplots/ymin})\nrectangle (axis ' ...
|
||||||
'pgfplots/ymax});\n\\end{pgfonlayer}\n'], ...
|
'cs:%f,\\pgfkeysvalueof{/pgfplots/ymax});\n\\end{pgfonlayer}\n'], ...
|
||||||
o.shadeColor, o.shadeOpacity,x1);
|
o.shadeColor, o.shadeOpacity, x2);
|
||||||
|
elseif x2 == dd.ndat
|
||||||
|
fprintf(fid,['\\begin{pgfonlayer}{background}\n\\fill[%s!%f]\n(axis ' ...
|
||||||
|
'cs:%f,\\pgfkeysvalueof{/pgfplots/ymin})\nrectangle (axis ' ...
|
||||||
|
'cs:\\pgfkeysvalueof{/pgfplots/xmax},\\pgfkeysvalueof{/' ...
|
||||||
|
'pgfplots/ymax});\n\\end{pgfonlayer}\n'], ...
|
||||||
|
o.shadeColor, o.shadeOpacity, x1);
|
||||||
|
else
|
||||||
|
fprintf(fid,['\\begin{pgfonlayer}{background}\n\\fill[%s!%f]\n(axis ' ...
|
||||||
|
'cs:%f,\\pgfkeysvalueof{/pgfplots/ymin})\nrectangle (axis ' ...
|
||||||
|
'cs:%f,\\pgfkeysvalueof{/pgfplots/ymax});\n\\end{pgfonlayer}\n'], ...
|
||||||
|
o.shadeColor, o.shadeOpacity, x1, x2);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
fprintf(fid, '\\end{axis}\n\\end{tikzpicture}\n');
|
fprintf(fid, '\\end{axis}\n\\end{tikzpicture}\n');
|
||||||
|
|
Loading…
Reference in New Issue