changeset 7712:a626db2e8a1c

view: get values from current axes if nargin == 0
author John W. Eaton <jwe@octave.org>
date Tue, 15 Apr 2008 16:30:09 -0400
parents 263bcc319233
children 050f695c3a78
files scripts/ChangeLog scripts/plot/view.m
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Tue Apr 15 02:29:08 2008 -0400
+++ b/scripts/ChangeLog	Tue Apr 15 16:30:09 2008 -0400
@@ -1,3 +1,7 @@
+2008-04-15  John W. Eaton  <jwe@octave.org>
+
+	* plot/view.m: Get values from current axes if nargin == 0.
+
 2008-04-015  David Bateman  <dbateman@free.fr>
 
 	* plot/__patch__.m: Fix for NaN values in faces of patches.
--- a/scripts/plot/view.m	Tue Apr 15 02:29:08 2008 -0400
+++ b/scripts/plot/view.m	Tue Apr 15 16:30:09 2008 -0400
@@ -28,7 +28,11 @@
 function [azimuth, elevation] = view (x, y, z)
 
   if (nargin < 4)
-    if (nargin == 1)
+    if (nargin == 0)
+      tmp = get (gca (), "view");
+      az = tmp(1);
+      el = tmp(2);
+    elseif (nargin == 1)
       if (x == 2)
 	az = 0;
 	el = 90;