From dd987523c860d4258874030595aa53cdf49e7a7f Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Tue, 9 Apr 2013 11:16:22 +0200
Subject: [PATCH] reporting: @graph: if shading, move to bottom

---
 matlab/reporting/@graph/createGraph.m | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/matlab/reporting/@graph/createGraph.m b/matlab/reporting/@graph/createGraph.m
index c579887667..3a2e079ed7 100644
--- a/matlab/reporting/@graph/createGraph.m
+++ b/matlab/reporting/@graph/createGraph.m
@@ -85,8 +85,11 @@ if ~isempty(o.shade)
 
     % From ShadePlotForEmpahsis (Matlab Exchange)
     % use patch bc area doesn't work with matlab2tikz
-    patch([repmat(x1, 1, 2) repmat(x2, 1, 2)], ...
-          [yrange fliplr(yrange)], 'b', 'FaceAlpha', .2);
+    sh = patch([repmat(x1, 1, 2) repmat(x2, 1, 2)], ...
+               [yrange fliplr(yrange)], 'b', 'FaceAlpha', .2);
+    children =get(gca(), 'children');
+    children = [children(2:end); sh];
+    set(gca(), 'children', children);
 end
 
 set(gca,'XTick', x);
-- 
GitLab