# HG changeset patch # User jwe # Date 1192123023 0 # Node ID 0058799917ac33a142a3d0363081c97e59baf86a # Parent 6304d9ea0a301e19a392a6ec1340121cc877a07a [project @ 2007-10-11 17:17:02 by jwe] diff -r 6304d9ea0a30 -r 0058799917ac scripts/ChangeLog --- a/scripts/ChangeLog Thu Oct 11 16:26:37 2007 +0000 +++ b/scripts/ChangeLog Thu Oct 11 17:17:03 2007 +0000 @@ -1,3 +1,9 @@ +2007-10-11 John W. Eaton + + * plot/__go_draw_axes__.m (get_axis_limits): + Return lim = [] if logscale and no positive values. + (__go_draw_axes__): Skip plotting if computed axis limits are empty. + 2007-10-11 Brian Gough * control/csrefcard.lt, control/system/is_detectable.m, diff -r 6304d9ea0a30 -r 0058799917ac scripts/plot/__go_draw_axes__.m --- a/scripts/plot/__go_draw_axes__.m Thu Oct 11 16:26:37 2007 +0000 +++ b/scripts/plot/__go_draw_axes__.m Thu Oct 11 17:17:03 2007 +0000 @@ -694,6 +694,9 @@ if (xautoscale && have_data) xlim = get_axis_limits (xmin, xmax, xminp, xlogscale); + if (isempty (xlim)) + return; + endif set (h, "xlim", xlim, "xlimmode", "auto"); else xlim = axis_obj.xlim; @@ -707,6 +710,9 @@ if (yautoscale && have_data) ylim = get_axis_limits (ymin, ymax, yminp, ylogscale); + if (isempty (ylim)) + return; + endif set (h, "ylim", ylim, "ylimmode", "auto"); else ylim = axis_obj.ylim; @@ -721,6 +727,9 @@ if (nd == 3) if (zautoscale && have_data) zlim = get_axis_limits (zmin, zmax, zminp, zlogscale); + if (isempty (zlim)) + return; + endif set (h, "zlim", zlim, "zlimmode", "auto"); else zlim = axis_obj.zlim; @@ -875,15 +884,14 @@ function lim = get_axis_limits (min_val, max_val, min_pos, logscale) if (logscale) - if (isinf (min_pos)) + if (isinf (min_pos) || isempty (min_pos)) + lim = []; warning ("axis: logscale with no positive values to plot"); + return; endif if (min_val <= 0) + warning ("axis: omitting nonpositive data in log plot"); min_val = min_pos; - if (max_val <= 0) - max_val = min_pos; - endif - warning ("axis: omitting nonpositive data in log plot"); endif ## FIXME -- maybe this test should also be relative? if (abs (min_val - max_val) < sqrt (eps))