diff --git a/matlab/reports/@graph/createGraph.m b/matlab/reports/@graph/createGraph.m index 922327441fee1c665bc892882e3360866eefd535..c579887667158a47dee6eef3dda609d444b388e0 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'];