# HG changeset patch # User jwe # Date 1170325537 0 # Node ID e5c3839f940387cc333253ecdd8f00588a315ee0 # Parent 598c2be12ab9da57de8e8987cc8a741fc9888578 [project @ 2007-02-01 10:25:37 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,5 +1,8 @@ 2007-02-01 John W. Eaton + * plot/__uiobject_draw_axes__.m: + Don't try to set axis limits unless we have data. + * plot/__plt1__.m, plot/__plt2__.m, plot/__plt2mm__.m, plot/__plt2mv__.m, plot/__plt2ss__.m, plot/__plt2vm__.m, plot/__plt2vv__.m, plot/__plt__.m, plot/__pltopt1__.m, diff --git a/scripts/plot/__uiobject_draw_axes__.m b/scripts/plot/__uiobject_draw_axes__.m --- a/scripts/plot/__uiobject_draw_axes__.m +++ b/scripts/plot/__uiobject_draw_axes__.m @@ -468,7 +468,9 @@ endfor - if (xautoscale) + have_data = ! isempty (data); + + if (xautoscale && have_data) xlim = get_axis_limits (xmin, xmax, xminp, xlogscale); set (h, "xlim", xlim); else @@ -476,7 +478,7 @@ endif fprintf (plot_stream, "set xrange [%g:%g];\n", xlim); - if (yautoscale) + if (yautoscale && have_data) ylim = get_axis_limits (ymin, ymax, yminp, ylogscale); set (h, "ylim", ylim); else @@ -485,7 +487,7 @@ fprintf (plot_stream, "set yrange [%g:%g];\n", ylim); if (nd == 3) - if (zautoscale) + if (zautoscale && have_data) zlim = get_axis_limits (zmin, zmax, zminp, zlogscale); set (h, "zlim", zlim); else