Mercurial > hg > octave-nkf
annotate scripts/plot/scatter3.m @ 14001:5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
* voronoi.m, image.m, imagesc.m, imshow.m, area.m, bar.m, barh.m, clabel.m,
clf.m, compass.m, ezcontour.m, ezcontourf.m, ezmesh.m, ezmeshc.m, ezplot.m,
ezplot3.m, ezpolar.m, ezsurf.m, ezsurfc.m, feather.m, fill.m, findall.m,
findobj.m, loglog.m, mesh.m, pareto.m, patch.m, pie.m, pie3.m, plot.m, polar.m,
quiver.m, quiver3.m, rectangle.m, ribbon.m, rose.m, scatter.m, scatter3.m,
semilogx.m, semilogy.m, slice.m, stem.m, surf.m, surface.m, text.m, title.m,
trimesh.m, triplot.m, trisurf.m, xlabel.m, ylabel.m, zlabel.m:
Update documentation for functions returning a graphics handle h.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Tue, 06 Dec 2011 13:09:17 -0800 |
parents | d6417ee864c9 |
children | 22c50cbad2ce |
rev | line source |
---|---|
11523 | 1 ## Copyright (C) 2007-2011 David Bateman |
7189 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
19 ## -*- texinfo -*- | |
10793
be55736a0783
Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents:
9295
diff
changeset
|
20 ## @deftypefn {Function File} {} scatter3 (@var{x}, @var{y}, @var{z}, @var{s}, @var{c}) |
7189 | 21 ## @deftypefnx {Function File} {} scatter3 (@dots{}, 'filled') |
22 ## @deftypefnx {Function File} {} scatter3 (@dots{}, @var{style}) | |
23 ## @deftypefnx {Function File} {} scatter3 (@dots{}, @var{prop}, @var{val}) | |
24 ## @deftypefnx {Function File} {} scatter3 (@var{h}, @dots{}) | |
25 ## @deftypefnx {Function File} {@var{h} =} scatter3 (@dots{}) | |
26 ## | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11563
diff
changeset
|
27 ## Plot a scatter plot of the data in 3D@. A marker is plotted at each point |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
28 ## defined by the points in the vectors @var{x}, @var{y} and @var{z}. The size |
8069
c64c9581e9bf
fix documentation of scatter3
Martin Weiser <weiser2@natur.cuni.cz>
parents:
7603
diff
changeset
|
29 ## of the markers used is determined by @var{s}, which can be a scalar or |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
30 ## a vector of the same length of @var{x}, @var{y} and @var{z}. If @var{s} is |
8069
c64c9581e9bf
fix documentation of scatter3
Martin Weiser <weiser2@natur.cuni.cz>
parents:
7603
diff
changeset
|
31 ## not given or is an empty matrix, then the default value of 8 points is used. |
7189 | 32 ## |
33 ## The color of the markers is determined by @var{c}, which can be a string | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11563
diff
changeset
|
34 ## defining a fixed color; a 3-element vector giving the red, green, and blue |
11563
3c6e8aaa9555
Grammarcheck m-files before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
35 ## components of the color; a vector of the same length as @var{x} that gives |
3c6e8aaa9555
Grammarcheck m-files before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
36 ## a scaled index into the current colormap; or a @var{n}-by-3 matrix defining |
7189 | 37 ## the colors of each of the markers individually. |
38 ## | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11563
diff
changeset
|
39 ## The marker to use can be changed with the @var{style} argument, that is a |
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11563
diff
changeset
|
40 ## string defining a marker in the same manner as the @code{plot} command. |
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11563
diff
changeset
|
41 ## If the argument 'filled' is given then the markers as filled. All |
7189 | 42 ## additional arguments are passed to the underlying patch command. |
43 ## | |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
12320
diff
changeset
|
44 ## The optional return value @var{h} is a graphics handle to the hggroup |
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
12320
diff
changeset
|
45 ## object representing the points. |
7189 | 46 ## |
47 ## @example | |
48 ## @group | |
49 ## [x, y, z] = peaks (20); | |
50 ## scatter3 (x(:), y(:), z(:), [], z(:)); | |
51 ## @end group | |
52 ## @end example | |
53 ## | |
54 ## @seealso{plot, patch, scatter} | |
55 ## @end deftypefn | |
56 | |
57 function retval = scatter3 (varargin) | |
58 | |
7215 | 59 [h, varargin, nargin] = __plt_get_axis_arg__ ("scatter3", varargin{:}); |
60 | |
7189 | 61 if (nargin < 2) |
62 print_usage (); | |
7215 | 63 else |
7189 | 64 oldh = gca (); |
65 unwind_protect | |
66 axes (h); | |
67 newplot (); | |
7215 | 68 tmp = __scatter__ (h, 3, "scatter3", varargin{:}); |
7189 | 69 unwind_protect_cleanup |
70 axes (oldh); | |
71 end_unwind_protect | |
72 endif | |
73 | |
74 if (! ishold ()) | |
12320
d6417ee864c9
scatter.m: pass h to set, not ax
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
75 set (h, "view", [-37.5, 30], |
11429
4286b8b999ab
scatter3.m: Grid on by default for 3D plots.
Ben Abbott <bpabbott@mac.com>
parents:
11363
diff
changeset
|
76 "xgrid", "on", "ygrid", "on", "zgrid", "on"); |
7189 | 77 endif |
78 | |
79 if (nargout > 0) | |
80 retval = tmp; | |
81 endif | |
82 | |
83 endfunction | |
7245 | 84 |
11363
a0dfd7e8e3e2
Assign data used in demo plots for reproducibility between runs
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
85 |
7245 | 86 %!demo |
87 %! [x, y, z] = peaks (20); | |
88 %! scatter3 (x(:), y(:), z(:), [], z(:)); | |
9295
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
89 |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
90 %!demo |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
91 %! x = rand (20,1); |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
92 %! y = rand (20,1); |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
93 %! z = rand (20,1); |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
94 %! scatter3 (x(:), y(:), z(:), 10, z(:), "s"); |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
95 |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
96 %!demo |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
97 %! x = rand (20,1); |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
98 %! y = rand (20,1); |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
99 %! z = rand (20,1); |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
100 %! scatter3 (x(:), y(:), z(:), 20*z(:), z(:), "s"); |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
101 |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
102 %!demo |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
103 %! x = rand (20,1); |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
104 %! y = rand (20,1); |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
105 %! z = rand (20,1); |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
106 %! scatter3 (x(:), y(:), z(:), 20*z(:), [], "s"); |
10b9a71a81f1
__scatter__.m: If the color spec is empty, set using __next_line_color__.
Ben Abbott <bpabbott@mac.com>
parents:
9245
diff
changeset
|
107 |