From e672d88d7aaf69e806d0ec494f50b1e945b00dba Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Tue, 9 Apr 2013 11:16:01 +0200 Subject: [PATCH] reporting: @graph: uistack fix for octave & move zeroline writing up --- matlab/reports/@graph/createGraph.m | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/matlab/reports/@graph/createGraph.m b/matlab/reports/@graph/createGraph.m index 922327441..c57988766 100644 --- a/matlab/reports/@graph/createGraph.m +++ b/matlab/reports/@graph/createGraph.m @@ -65,6 +65,16 @@ if ~isempty(o.yrange) ylim(o.yrange); end +if o.zeroline + a = ylim; + if 0 > a(1) && 0 < a(2) + lh = line(xlim, [0 0], 'color', 'k', 'LineWidth', 0.25); + children =get(gca(), 'children'); + children = [children(2:end); lh]; + set(gca(), 'children', children); + end +end + if ~isempty(o.shade) x1 = find(strcmpi(o.shade(1).format(), xlabels)); x2 = find(strcmpi(o.shade(o.shade.ndat).format(), xlabels)); @@ -101,14 +111,6 @@ end if ~isempty(o.title) title( o.title, 'Interpreter', 'LaTex'); end - -if o.zeroline - a = ylim; - if 0 > a(1) && 0 < a(2) - lh = line(xlim, [0 0], 'color', 'k', 'LineWidth', 0.25); - uistack(lh, 'bottom'); - end -end drawnow; o.figname = [tempname '.tex']; -- GitLab