# HG changeset patch # User Nicholas R. Jankowski # Date 1714055626 14400 # Node ID f3376b53696953a2bbc760d92847925ba17052cb # Parent 6993450e2f7197002700a5befdc0f422300d2d3b# Parent c224e1a810d6e29741444c9b27c07895a4154350 maint: Merge default to bytecode-interpreter. diff -r 6993450e2f71 -r f3376b536969 scripts/plot/appearance/view.m --- a/scripts/plot/appearance/view.m Wed Apr 24 18:31:26 2024 -0400 +++ b/scripts/plot/appearance/view.m Thu Apr 25 10:33:46 2024 -0400 @@ -66,6 +66,8 @@ vw = get (hax, "view"); az = vw(1); el = vw(2); + elseif (nargout > 0) + error ("view: cannot simultaneously get and set viewpoint"); elseif (numel (varargin) == 1) x = varargin{1}; if (numel (x) == 2) @@ -135,5 +137,38 @@ %! close (hf); %! end_unwind_protect +%!test <*57800> +%! hf = figure ("visible", "off"); +%! unwind_protect +%! plot3 ([0,1], [0,1], [0,1]); +%! view (3); +%! view ([0, 0, 1]); +%! [az, el] = view (); +%! assert ([az, el], [0, 90], eps); +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect + +%!test <65641> +%! hf = figure ("visible", "off"); +%! unwind_protect +%! plot3 ([0,1], [0,1], [0,1]); +%! view (3); +%! view ([0, -1, 0]); +%! [az, el] = view (); +%! assert ([az, el], [0, 0], eps); +%! view (3); +%! view ([1, 0, 0]); +%! [az, el] = view (); +%! assert ([az, el], [90, 0], eps); +%! view (3); +%! view ([1, 0.001, 0]); +%! [az, el] = view (); +%! assert ([az, el], [0, 90 + 0.001*180/pi], eps); +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect + ## Test input validation %!error view (0, 0, 1) +%!error [a, b] = view ([1, 1, 1])