# HG changeset patch # User Rik # Date 1652643395 25200 # Node ID d2c09591eb11c7322553e7760ccd7a9385adb764 # Parent fef2957c38ec50d6dd1a161091b6f52830411f66# Parent f69dbed63186b502793b3e050787ea2c12c3d97e maint: merge stable to default diff -r fef2957c38ec -r d2c09591eb11 scripts/plot/appearance/private/__axis_limits__.m --- a/scripts/plot/appearance/private/__axis_limits__.m Sat May 14 19:06:56 2022 -0700 +++ b/scripts/plot/appearance/private/__axis_limits__.m Sun May 15 12:36:35 2022 -0700 @@ -49,7 +49,7 @@ set (hax, fcnmode, arg); endif else - if (! isnumeric (arg) && any (size (arg(:)) != [2, 1])) + if (! isnumeric (arg) || any (size (arg(:)) != [2, 1])) error ("%s: LIMITS must be a 2-element vector", fcn); elseif (arg(1) >= arg(2)) error ("%s: axis limits must be increasing", fcn); diff -r fef2957c38ec -r d2c09591eb11 scripts/plot/appearance/xlim.m --- a/scripts/plot/appearance/xlim.m Sat May 14 19:06:56 2022 -0700 +++ b/scripts/plot/appearance/xlim.m Sun May 15 12:36:35 2022 -0700 @@ -110,3 +110,17 @@ %! unwind_protect_cleanup %! close (hf); %! end_unwind_protect + +%!test +%! ## Test input validation, done only in xlim since it is common to ylim,zlim. +%! hf = figure ("visible", "off"); +%! unwind_protect +%! h = plot3 ([0,1.1], [0,1], [0, 1]); +%! fail ("xlim ({1, 2})", "LIMITS must be a 2-element vector"); +%! fail ("xlim ([1, 2, 3])", "LIMITS must be a 2-element vector"); +%! fail ("xlim ([2, 1])", "axis limits must be increasing"); +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect + +