Mercurial > octave
annotate scripts/plot/draw/ezsurfc.m @ 33670:9dd2a8e7e0d5 default tip @
uifigure.m: Make sure variable exists before it is used (bug #65459).
* scripts/gui/uifigure.m: The variable "props" might have been used before it
existed. Make sure it exists for all code paths.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Mon, 24 Jun 2024 10:29:15 +0200 |
parents | 2e484f9f1f18 |
children |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 ######################################################################## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 ## |
32632
2e484f9f1f18
maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31706
diff
changeset
|
3 ## Copyright (C) 2007-2024 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
4 ## |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 ## See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 ## distribution or <https://octave.org/copyright/>. |
7337 | 7 ## |
8 ## This file is part of Octave. | |
9 ## | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24455
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
7337 | 11 ## under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24455
diff
changeset
|
12 ## the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
13 ## (at your option) any later version. |
7337 | 14 ## |
15 ## Octave is distributed in the hope that it will be useful, but | |
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
18 ## GNU General Public License for more details. |
7337 | 19 ## |
20 ## You should have received a copy of the GNU General Public License | |
21 ## along with Octave; see the file COPYING. If not, see | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24455
diff
changeset
|
22 ## <https://www.gnu.org/licenses/>. |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 ## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 ######################################################################## |
7337 | 25 |
26 ## -*- texinfo -*- | |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
27 ## @deftypefn {} {} ezsurfc (@var{f}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
28 ## @deftypefnx {} {} ezsurfc (@var{fx}, @var{fy}, @var{fz}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
29 ## @deftypefnx {} {} ezsurfc (@dots{}, @var{dom}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
30 ## @deftypefnx {} {} ezsurfc (@dots{}, @var{n}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
31 ## @deftypefnx {} {} ezsurfc (@dots{}, "circ") |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
32 ## @deftypefnx {} {} ezsurfc (@var{hax}, @dots{}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
33 ## @deftypefnx {} {@var{h} =} ezsurfc (@dots{}) |
7337 | 34 ## |
16993
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
35 ## Plot the surface and contour lines defined by a function. |
7337 | 36 ## |
16993
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
37 ## @var{f} is a string, inline function, or function handle with two arguments |
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
38 ## defining the function. By default the plot is over the meshed domain |
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
39 ## @code{-2*pi <= @var{x} | @var{y} <= 2*pi} with 60 points in each dimension. |
7337 | 40 ## |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
41 ## If three functions are passed, then plot the parametrically defined |
24454
b9d482dd90f3
doc: Fix mistaken use of space between function and '(' in documentation (bug #52723).
Rik <rik@octave.org>
parents:
24431
diff
changeset
|
42 ## function @code{[@var{fx}(@var{s}, @var{t}), @var{fy}(@var{s}, @var{t}), |
b9d482dd90f3
doc: Fix mistaken use of space between function and '(' in documentation (bug #52723).
Rik <rik@octave.org>
parents:
24431
diff
changeset
|
43 ## @var{fz}(@var{s}, @var{t})]}. |
7337 | 44 ## |
16993
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
45 ## If @var{dom} is a two element vector, it represents the minimum and maximum |
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
46 ## values of both @var{x} and @var{y}. If @var{dom} is a four element vector, |
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
47 ## then the minimum and maximum values are @code{[xmin xmax ymin ymax]}. |
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
48 ## |
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
49 ## @var{n} is a scalar defining the number of points to use in each dimension. |
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
50 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
51 ## If the argument @qcode{"circ"} is given, then the function is plotted over |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
52 ## a disk centered on the middle of the domain @var{dom}. |
7337 | 53 ## |
24431
0c6cedafc71e
doc: Use 'axes' rather than 'axis' appropriately in docstrings.
Rik <rik@octave.org>
parents:
23219
diff
changeset
|
54 ## If the first argument @var{hax} is an axes handle, then plot into this axes, |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
16993
diff
changeset
|
55 ## rather than the current axes returned by @code{gca}. |
16993
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
56 ## |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
57 ## The optional return value @var{h} is a 2-element vector with a graphics |
16993
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
58 ## handle for the created surface plot and a second handle for the created |
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
59 ## contour plot. |
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
60 ## |
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
61 ## Example: |
7337 | 62 ## |
63 ## @example | |
64 ## @group | |
14327
4d917a6a858b
doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
65 ## f = @@(x,y) sqrt (abs (x .* y)) ./ (1 + x.^2 + y.^2); |
7337 | 66 ## ezsurfc (f, [-3, 3]); |
67 ## @end group | |
68 ## @end example | |
69 ## | |
16993
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
70 ## @seealso{surfc, ezsurf, ezplot, ezmesh, ezmeshc, shading} |
7337 | 71 ## @end deftypefn |
72 | |
16993
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
73 function h = ezsurfc (varargin) |
7337 | 74 |
16993
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
75 [htmp, needusage] = __ezplot__ ("surfc", varargin{:}); |
7337 | 76 |
77 if (needusage) | |
78 print_usage (); | |
79 endif | |
80 | |
81 if (nargout > 0) | |
16993
78f57b14535c
Overhaul ez* family of plot functions.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
82 h = htmp; |
7337 | 83 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
|
84 |
7337 | 85 endfunction |
86 | |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
87 |
7337 | 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; |
22302
1c4cd12987f5
Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents:
20852
diff
changeset
|
90 %! colormap ("default"); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
91 %! f = @(x,y) sqrt (abs (x .* y)) ./ (1 + x.^2 + y.^2); |
7337 | 92 %! ezsurfc (f, [-3, 3]); |