# HG changeset patch # User Nicholas R. Jankowski # Date 1714060464 14400 # Node ID 2f5a875246aecf2bb77fa93160b775f30624cfe4 # Parent 4401310ad7377a8b178e79dc2fba462a315240de view.m: Move input validation to avoid creating figure on error (bug #65641) * view.m: Move check for simultaneous viewpoint get and set ahead of axes object creation. * NEWS.10.md: note change to view under Graphics backend section. diff -r 4401310ad737 -r 2f5a875246ae etc/NEWS.10.md --- a/etc/NEWS.10.md Thu Apr 25 11:41:04 2024 -0400 +++ b/etc/NEWS.10.md Thu Apr 25 11:54:24 2024 -0400 @@ -38,6 +38,8 @@ to 'rtick' by the function `rticks` will only include the center tick mark value if it is specified. +- `view` correctly interprets cartesion viewpoints on main axes. (bug #65641) + ### Matlab compatibility - `height` and `width` are now aliases for the `rows` and `columns` functions. diff -r 4401310ad737 -r 2f5a875246ae scripts/plot/appearance/view.m --- a/scripts/plot/appearance/view.m Thu Apr 25 11:41:04 2024 -0400 +++ b/scripts/plot/appearance/view.m Thu Apr 25 11:54:24 2024 -0400 @@ -58,6 +58,10 @@ print_usage (); endif + if (nargout > 0 && nargin > 0) + error ("view: cannot simultaneously get and set viewpoint"); + endif + if (isempty (hax)) hax = gca (); endif @@ -66,8 +70,6 @@ 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)