Mercurial > hg > octave-lyh
diff scripts/plot/plotyy.m @ 11587:c792872f8942
all script files: untabify and strip trailing whitespace
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Jan 2011 17:35:29 -0500 |
parents | fd0a3ac60b0e |
children | b0084095098e |
line wrap: on
line diff
--- a/scripts/plot/plotyy.m +++ b/scripts/plot/plotyy.m @@ -24,15 +24,15 @@ ## @deftypefnx {Function File} {[@var{ax}, @var{h1}, @var{h2}] =} plotyy (@dots{}) ## Plots two sets of data with independent y-axes. The arguments @var{x1} and ## @var{y1} define the arguments for the first plot and @var{x1} and @var{y2} -## for the second. +## for the second. ## -## By default the arguments are evaluated with +## By default the arguments are evaluated with ## @code{feval (@@plot, @var{x}, @var{y})}. However the type of plot can be ## modified with the @var{fun} argument, in which case the plots are -## generated by @code{feval (@var{fun}, @var{x}, @var{y})}. @var{fun} can be +## generated by @code{feval (@var{fun}, @var{x}, @var{y})}. @var{fun} can be ## a function handle, an inline function or a string of a function name. ## -## The function to use for each of the plots can be independently defined +## The function to use for each of the plots can be independently defined ## with @var{fun1} and @var{fun2}. ## ## If given, @var{h} defines the principal axis in which to plot the @var{x1} @@ -42,7 +42,7 @@ ## ## @example ## @group -## x = 0:0.1:2*pi; +## x = 0:0.1:2*pi; ## y1 = sin (x); ## y2 = exp (x - 1); ## ax = plotyy (x, y1, x - 1, y2, @@plot, @@semilogy); @@ -56,7 +56,7 @@ function [Ax, H1, H2] = plotyy (varargin) ## Don't use __plt_get_axis_arg__ here as ax is a two vector for plotyy - if (nargin > 1 && length (varargin{1}) == 2 && ishandle(varargin{1}(1)) + if (nargin > 1 && length (varargin{1}) == 2 && ishandle(varargin{1}(1)) && ishandle(varargin{1}(2)) && all (floor (varargin{1}) != varargin{1})) obj1 = get (varargin{1}(1)); @@ -97,7 +97,7 @@ if (nargin < 2) varargin = {}; endif - endif + endif if (nargin < 4) print_usage (); @@ -169,12 +169,12 @@ set (ax(2), "xlim", xlim); set (ax(2), "color", "none"); - ## Add invisible text objects that when destroyed, + ## Add invisible text objects that when destroyed, ## also remove the other axis - t1 = text (0, 0, "", "parent", ax(1), "tag", "plotyy", + t1 = text (0, 0, "", "parent", ax(1), "tag", "plotyy", "handlevisibility", "off", "visible", "off", "xliminclude", "off", "yliminclude", "off"); - t2 = text (0, 0, "", "parent", ax(2), "tag", "plotyy", + t2 = text (0, 0, "", "parent", ax(2), "tag", "plotyy", "handlevisibility", "off", "visible", "off", "xliminclude", "off", "yliminclude", "off"); @@ -199,12 +199,12 @@ set (ax(2), "userdata", ax(1)); ## Store the axes handles for the sister axes. - try + try addproperty ("__plotyy_axes__", ax(1), "data", ax); catch set (ax(1), "__plotyy_axes__", ax); end_try_catch - try + try addproperty ("__plotyy_axes__", ax(2), "data", ax); catch set (ax(2), "__plotyy_axes__", ax); @@ -213,7 +213,7 @@ %!demo %! clf -%! x = 0:0.1:2*pi; +%! x = 0:0.1:2*pi; %! y1 = sin (x); %! y2 = exp (x - 1); %! ax = plotyy (x, y1, x - 1, y2, @plot, @semilogy); @@ -267,7 +267,7 @@ if (! (isequal (position, oldposition) && isequal (view, oldview))) set (ax2, "position", position, "view", view) endif - if (! (isequal (plotboxaspectratio, oldplotboxaspectratio) + if (! (isequal (plotboxaspectratio, oldplotboxaspectratio) && isequal (plotboxaspectratiomode, oldplotboxaspectratiomode))) set (ax2, "plotboxaspectratio", plotboxaspectratio); set (ax2, "plotboxaspectratiomode", plotboxaspectratiomode); @@ -275,7 +275,7 @@ unwind_protect_cleanup recursion = false; end_unwind_protect - endif + endif endfunction function color = getcolor (ax)