annotate scripts/plot/ezplot.m @ 14335:ce2b59a6d0e5

maint: periodic merge of stable to default.
author Rik <octave@nomad.inbox5.com>
date Sun, 05 Feb 2012 15:32:24 -0800
parents 4506eade9f04 4d917a6a858b
children 78f57b14535c
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})
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
21 ## @deftypefnx {Function File} {} ezplot (@var{fx}, @var{fy})
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
22 ## @deftypefnx {Function File} {} ezplot (@dots{}, @var{dom})
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
23 ## @deftypefnx {Function File} {} ezplot (@dots{}, @var{n})
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
24 ## @deftypefnx {Function File} {} ezplot (@var{h}, @dots{})
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
25 ## @deftypefnx {Function File} {@var{h} =} ezplot (@dots{})
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
26 ##
14038
b0cdd60db5e5 doc: Grammarcheck documentation ahead of 3.6.0 release.
Rik <octave@nomad.inbox5.com>
parents: 14001
diff changeset
27 ## Plot the curve defined by @var{f} in two dimensions. The function
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
28 ## @var{f} may be a string, inline function or function handle and can
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
29 ## have either one or two variables. If @var{f} has one variable, then
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
30 ## 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
31 ## with 500 points.
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
32 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
33 ## If @var{f} has two variables then @code{@var{f}(@var{x},@var{y}) = 0}
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
34 ## is calculated over the meshed domain @code{-2*pi < @var{x} | @var{y}
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
35 ## < 2*pi} with 60 by 60 in the mesh. For example:
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
36 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
37 ## @example
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
38 ## 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
39 ## @end example
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 ## If two functions are passed as strings, inline functions or function
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
42 ## handles, then the parametric function
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
43 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
44 ## @example
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
45 ## @group
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
46 ## @var{x} = @var{fx} (@var{t})
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
47 ## @var{y} = @var{fy} (@var{t})
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
48 ## @end group
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
49 ## @end example
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
50 ##
10846
a4f482e66b65 Grammarcheck more of the documentation.
Rik <octave@nomad.inbox5.com>
parents: 10821
diff changeset
51 ## @noindent
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
52 ## is plotted over the domain @code{-2*pi < @var{t} < 2*pi} with 500
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
53 ## points.
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
54 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
55 ## If @var{dom} is a two element vector, it represents the minimum and maximum
9040
dbd0c77e575e Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents: 8046
diff changeset
56 ## value of @var{x}, @var{y} and @var{t}. If it is a four element
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
57 ## vector, then the minimum and maximum values of @var{x} and @var{t}
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
58 ## are determined by the first two elements and the minimum and maximum
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
59 ## of @var{y} by the second pair of elements.
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
60 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
61 ## @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
62 ## the function.
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
63 ##
14001
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11587
diff changeset
64 ## The optional return value @var{h} is a graphics handle to the created plot.
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
65 ##
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
66 ## @seealso{plot, ezplot3}
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
67 ## @end deftypefn
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
68
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
69 function retval = ezplot (varargin)
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
70
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
71 [h, needusage] = __ezplot__ ("plot", varargin{:});
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
72
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
73 if (needusage)
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
74 print_usage ();
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
75 endif
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
76
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
77 if (nargout > 0)
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
78 retval = h;
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
79 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
80
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
81 endfunction
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
82
14001
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11587
diff changeset
83
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
84 %!demo
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 %! clf;
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
86 %! ezplot (@cos, @sin);
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
87
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
88 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
89 %! clf;
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
90 %! ezplot ('1/x');
8046
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
91
c4482fc30c7f Add the ezplot function
David Bateman <dbateman@free.fr>
parents:
diff changeset
92 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
93 %! clf;
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
94 %! ezplot (inline ('x^2 - y^2 = 1'));
14001
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11587
diff changeset
95