annotate scripts/plot/ezplot.m @ 17122:eaab03308c0b

doc: Rewrite docstrings for most plot functions. Emphasize clarity, use common "voice", and increase density of seealso links. * doc/interpreter/plot.txi: Add @findex entries that were in xlim.m * scripts/miscellaneous/getappdata.m scripts/miscellaneous/setappdata.m, scripts/plot/allchild.m, scripts/plot/ancestor.m, scripts/plot/area.m, scripts/plot/axes.m, scripts/plot/axis.m, scripts/plot/bar.m, scripts/plot/barh.m, scripts/plot/box.m, scripts/plot/caxis.m, scripts/plot/cla.m, scripts/plot/clabel.m, scripts/plot/clf.m, scripts/plot/close.m, scripts/plot/closereq.m, scripts/plot/colorbar.m, scripts/plot/comet.m, scripts/plot/comet3.m, scripts/plot/compass.m, scripts/plot/contour.m, scripts/plot/contour3.m, scripts/plot/contourc.m, scripts/plot/contourf.m, scripts/plot/copyobj.m, scripts/plot/cylinder.m, scripts/plot/daspect.m, scripts/plot/diffuse.m, scripts/plot/ellipsoid.m, scripts/plot/errorbar.m, scripts/plot/ezcontour.m, scripts/plot/ezcontourf.m, scripts/plot/ezmesh.m, scripts/plot/ezmeshc.m, scripts/plot/ezplot.m, scripts/plot/ezplot3.m, scripts/plot/ezpolar.m, scripts/plot/ezsurf.m, scripts/plot/ezsurfc.m, scripts/plot/feather.m, scripts/plot/figure.m, scripts/plot/fill.m, scripts/plot/findall.m, scripts/plot/findobj.m, scripts/plot/fplot.m, scripts/plot/gca.m, scripts/plot/gcbf.m, scripts/plot/gcbo.m, scripts/plot/gcf.m, scripts/plot/gco.m, scripts/plot/ginput.m, scripts/plot/graphics_toolkit.m, scripts/plot/grid.m, scripts/plot/gtext.m, scripts/plot/guidata.m, scripts/plot/guihandles.m, scripts/plot/hdl2struct.m, scripts/plot/hggroup.m, scripts/plot/hidden.m, scripts/plot/hist.m, scripts/plot/hold.m, scripts/plot/ishghandle.m, scripts/plot/ishold.m, scripts/plot/isocolors.m, scripts/plot/isprop.m, scripts/plot/legend.m, scripts/plot/line.m, scripts/plot/linkprop.m, scripts/plot/loglog.m, scripts/plot/loglogerr.m, scripts/plot/mesh.m, scripts/plot/meshc.m, scripts/plot/meshgrid.m, scripts/plot/meshz.m, scripts/plot/newplot.m, scripts/plot/orient.m, scripts/plot/pareto.m, scripts/plot/patch.m, scripts/plot/pcolor.m, scripts/plot/peaks.m, scripts/plot/pie.m, scripts/plot/pie3.m, scripts/plot/plot.m, scripts/plot/plot3.m, scripts/plot/plotmatrix.m, scripts/plot/plotyy.m, scripts/plot/polar.m, scripts/plot/print.m, scripts/plot/quiver.m, scripts/plot/quiver3.m, scripts/plot/rectangle.m, scripts/plot/refresh.m, scripts/plot/refreshdata.m, scripts/plot/ribbon.m, scripts/plot/rose.m, scripts/plot/saveas.m, scripts/plot/scatter.m, scripts/plot/scatter3.m, scripts/plot/semilogx.m, scripts/plot/semilogxerr.m, scripts/plot/semilogy.m, scripts/plot/semilogyerr.m, scripts/plot/shading.m, scripts/plot/shg.m, scripts/plot/shrinkfaces.m, scripts/plot/slice.m, scripts/plot/specular.m, scripts/plot/sphere.m, scripts/plot/stairs.m, scripts/plot/stem.m, scripts/plot/stem3.m, scripts/plot/struct2hdl.m, scripts/plot/subplot.m, scripts/plot/surf.m, scripts/plot/surface.m, scripts/plot/surfc.m, scripts/plot/surfl.m, scripts/plot/tetramesh.m, scripts/plot/text.m, scripts/plot/title.m, scripts/plot/trimesh.m, scripts/plot/triplot.m, scripts/plot/trisurf.m, scripts/plot/view.m, scripts/plot/waitbar.m, scripts/plot/waitforbuttonpress.m, scripts/plot/waterfall.m, scripts/plot/whitebg.m, scripts/plot/xlabel.m, scripts/plot/xlim.m, scripts/plot/ylabel.m, scripts/plot/ylim.m, scripts/plot/zlabel.m, scripts/plot/zlim.m: Rewrite docstrings for most plot functions. Emphasize clarity, use common "voice", and increase density of seealso links.
author Rik <rik@octave.org>
date Wed, 31 Jul 2013 13:53:30 -0700
parents 78f57b14535c
children df4c4b7708a4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 14092
diff changeset
1 ## Copyright (C) 2008-2012 David Bateman
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
2 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
3 ## This file is part of Octave.
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
4 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
8 ## your option) any later version.
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
9 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
13 ## General Public License for more details.
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
14 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
18
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
19 ## -*- texinfo -*-
10793
be55736a0783 Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents: 9245
diff changeset
20 ## @deftypefn {Function File} {} ezplot (@var{f})
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
21 ## @deftypefnx {Function File} {} ezplot (@var{f2v})
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
22 ## @deftypefnx {Function File} {} ezplot (@var{fx}, @var{fy})
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
23 ## @deftypefnx {Function File} {} ezplot (@dots{}, @var{dom})
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
24 ## @deftypefnx {Function File} {} ezplot (@dots{}, @var{n})
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
25 ## @deftypefnx {Function File} {} ezplot (@var{hax}, @dots{})
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
26 ## @deftypefnx {Function File} {@var{h} =} ezplot (@dots{})
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
27 ##
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
28 ## Plot the 2-D curve defined by the function @var{f}.
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
29 ##
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
30 ## The function @var{f} may be a string, inline function, or function handle
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
31 ## and can have either one or two variables. If @var{f} has one variable, then
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
32 ## the function is plotted over the domain @code{-2*pi < @var{x} < 2*pi}
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
33 ## with 500 points.
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
34 ##
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
35 ## If @var{f2v} is a function of two variables then the implicit function
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
36 ## @code{@var{f}(@var{x},@var{y}) = 0} is calculated over the meshed domain
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
37 ## @code{-2*pi <= @var{x} | @var{y} <= 2*pi} with 60 points in each dimension.
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
38 ##
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
39 ## For example:
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
40 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
41 ## @example
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
42 ## ezplot (@@(@var{x}, @var{y}) @var{x}.^2 - @var{y}.^2 - 1)
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
43 ## @end example
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
44 ##
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
45 ## If two functions are passed as inputs then the parametric function
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
46 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
47 ## @example
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
48 ## @group
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
49 ## @var{x} = @var{fx} (@var{t})
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
50 ## @var{y} = @var{fy} (@var{t})
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
51 ## @end group
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
52 ## @end example
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
53 ##
10846
a4f482e66b65 Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents: 10821
diff changeset
54 ## @noindent
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
55 ## is plotted over the domain @code{-2*pi <= @var{t} <= 2*pi} with 500 points.
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
56 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
57 ## If @var{dom} is a two element vector, it represents the minimum and maximum
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
58 ## values of both @var{x} and @var{y}, or @var{t} for a parametric plot. If
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
59 ## @var{dom} is a four element vector, then the minimum and maximum values are
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
60 ## @code{[xmin xmax ymin ymax]}.
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
61 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
62 ## @var{n} is a scalar defining the number of points to use in plotting
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
63 ## the function.
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
64 ##
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 16993
diff changeset
65 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 16993
diff changeset
66 ## rather than the current axes returned by @code{gca}.
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
67 ##
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 16993
diff changeset
68 ## The optional return value @var{h} is a vector of graphics handles to
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 16993
diff changeset
69 ## the created line objects.
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
70 ##
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
71 ## @seealso{plot, ezplot3, ezpolar, ezcontour, ezcontourf, ezmesh, ezmeshc, ezsurf, ezsurfc}
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
72 ## @end deftypefn
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
73
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
74 function h = ezplot (varargin)
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
75
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
76 [htmp, needusage] = __ezplot__ ("plot", varargin{:});
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
77
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
78 if (needusage)
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
79 print_usage ();
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
80 endif
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
81
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
82 if (nargout > 0)
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
83 h = htmp;
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
84 endif
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
85
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
86 endfunction
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
87
14001
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11587
diff changeset
88
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
89 %!demo
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
90 %! ## sinc function using function handle
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
91 %! f = @(x) sin (pi*x) ./ (pi*x);
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
92 %! ezplot (f);
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
93
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
94 %!demo
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
95 %! ## example of a function string and explicit limits
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
96 %! clf;
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
97 %! ezplot ('1/x', [-2 2]);
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
98
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
99 %!demo
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
100 %! ## parameterized function example over -2*pi <= t <= +2*pi
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
101 %! clf;
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
102 %! ezplot (@cos, @sin);
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
103
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
104 %!demo
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
105 %! ## implicit function of 2 variables
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
106 %! clf;
16993
78f57b14535c Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents: 14335
diff changeset
107 %! ezplot (inline ('x^2 - y^2 - 1'));
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
108