Mercurial > hg > octave-nkf
comparison scripts/plot/plotyy.m @ 7215:dd88d61d443f
[project @ 2007-11-29 16:44:45 by jwe]
author | jwe |
---|---|
date | Thu, 29 Nov 2007 16:46:40 +0000 |
parents | a730e47fda4d |
children | 5389a52df87b |
comparison
equal
deleted
inserted
replaced
7214:86d0b16f2bb2 | 7215:dd88d61d443f |
---|---|
53 ## @end example | 53 ## @end example |
54 ## @end deftypefn | 54 ## @end deftypefn |
55 | 55 |
56 function [Ax, H1, H2] = plotyy (varargin) | 56 function [Ax, H1, H2] = plotyy (varargin) |
57 | 57 |
58 if (isscalar (varargin{1}) && ishandle (varargin{1})) | 58 [ax, varargin] = __plt_get_axis_arg__ ("plotyy", varargin{:}); |
59 ax = varargin{1}; | 59 |
60 if (! strcmp (get (ax, "type"), "axes")) | 60 if (nargin < 4) |
61 error ("plotyy: expecting first argument to be an axes object"); | 61 print_usage (); |
62 endif | 62 endif |
63 if (nargin < 5) | 63 oldh = gca (); |
64 print_usage (); | 64 unwind_protect |
65 endif | 65 axes (ax); |
66 oldh = gca (); | |
67 unwind_protect | |
68 axes (ax); | |
69 newplot (); | |
70 [ax, h1, h2] = __plotyy__ (ax, varargin{2:end}); | |
71 unwind_protect_cleanup | |
72 axes (oldh); | |
73 end_unwind_protect | |
74 else | |
75 if (nargin < 4) | |
76 print_usage (); | |
77 endif | |
78 newplot (); | 66 newplot (); |
79 [ax, h1, h2] = __plotyy__ (gca (), varargin{:}); | 67 [ax, h1, h2] = __plotyy__ (ax, varargin{:}); |
80 endif | 68 unwind_protect_cleanup |
69 axes (oldh); | |
70 end_unwind_protect | |
81 | 71 |
82 if (nargout > 0) | 72 if (nargout > 0) |
83 Ax = ax; | 73 Ax = ax; |
84 H1 = h1; | 74 H1 = h1; |
85 H2 = h2; | 75 H2 = h2; |