Mercurial > hg > octave-lyh
annotate scripts/plot/quiver3.m @ 16808:772f51539af8
doc: Add gco() to documentation.
* doc/interpreter/plot.txi: Add gco() to manual.
* scripts/plot/gco.m: Add seealso links to docstring.
* scripts/plot/gcbf.m: Re-arrange seealso links. Improve docstring.
* scripts/plot/gcbo.m: Rewrite second paragraph of docstring.
Add seealso link to gco.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 22 Jun 2013 11:16:04 -0700 |
parents | 5d3a684236b0 |
children | 64e7bb01fce2 |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
14092
diff
changeset
|
1 ## Copyright (C) 2007-2012 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:
9040
diff
changeset
|
20 ## @deftypefn {Function File} {} quiver3 (@var{u}, @var{v}, @var{w}) |
7189 | 21 ## @deftypefnx {Function File} {} quiver3 (@var{x}, @var{y}, @var{z}, @var{u}, @var{v}, @var{w}) |
22 ## @deftypefnx {Function File} {} quiver3 (@dots{}, @var{s}) | |
23 ## @deftypefnx {Function File} {} quiver3 (@dots{}, @var{style}) | |
14359
7277fe922e99
doc: Use Octave preference for double quote in docstrings in scripts/
Rik <octave@nomad.inbox5.com>
parents:
14247
diff
changeset
|
24 ## @deftypefnx {Function File} {} quiver3 (@dots{}, "filled") |
7189 | 25 ## @deftypefnx {Function File} {} quiver3 (@var{h}, @dots{}) |
26 ## @deftypefnx {Function File} {@var{h} =} quiver3 (@dots{}) | |
27 ## | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
28 ## Plot the @code{(@var{u}, @var{v}, @var{w})} components of a vector field in |
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
29 ## an @code{(@var{x}, @var{y}), @var{z}} meshgrid. If the grid is uniform, you |
7189 | 30 ## can specify @var{x}, @var{y} @var{z} as vectors. |
31 ## | |
32 ## If @var{x}, @var{y} and @var{z} are undefined they are assumed to be | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
33 ## @code{(1:@var{m}, 1:@var{n}, 1:@var{p})} where @code{[@var{m}, @var{n}] = |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14363
diff
changeset
|
34 ## size (@var{u})} and @code{@var{p} = max (size (@var{w}))}. |
7189 | 35 ## |
36 ## The variable @var{s} is a scalar defining a scaling factor to use for | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
37 ## the arrows of the field relative to the mesh spacing. A value of 0 |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
38 ## disables all scaling. The default value is 1. |
7189 | 39 ## |
40 ## The style to use for the plot can be defined with a line style @var{style} | |
41 ## in a similar manner to the line styles used with the @code{plot} command. | |
42 ## If a marker is specified then markers at the grid points of the vectors are | |
14359
7277fe922e99
doc: Use Octave preference for double quote in docstrings in scripts/
Rik <octave@nomad.inbox5.com>
parents:
14247
diff
changeset
|
43 ## printed rather than arrows. If the argument "filled" is given then the |
7189 | 44 ## markers as filled. |
45 ## | |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
46 ## The optional return value @var{h} is a graphics handle to a quiver object. |
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
47 ## A quiver object regroups the components of the quiver plot (body, arrow, |
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
48 ## and marker), and allows them to be changed together. |
7189 | 49 ## |
50 ## @example | |
51 ## @group | |
52 ## [x, y, z] = peaks (25); | |
53 ## surf (x, y, z); | |
54 ## hold on; | |
55 ## [u, v, w] = surfnorm (x, y, z / 10); | |
8056
9a6f4713f765
Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents:
7245
diff
changeset
|
56 ## h = quiver3 (x, y, z, u, v, w); |
9a6f4713f765
Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents:
7245
diff
changeset
|
57 ## set (h, "maxheadsize", 0.33); |
7189 | 58 ## @end group |
59 ## @end example | |
60 ## | |
61 ## @seealso{plot} | |
62 ## @end deftypefn | |
63 | |
64 function retval = quiver3 (varargin) | |
65 | |
7215 | 66 [h, varargin, nargin] = __plt_get_axis_arg__ ("quiver3", varargin{:}); |
67 | |
7189 | 68 if (nargin < 2) |
69 print_usage (); | |
7215 | 70 else |
7189 | 71 oldh = gca (); |
72 unwind_protect | |
73 axes (h); | |
74 newplot (); | |
7215 | 75 tmp = __quiver__ (h, 1, varargin{:}); |
7189 | 76 unwind_protect_cleanup |
77 axes (oldh); | |
78 end_unwind_protect | |
79 endif | |
80 | |
81 if (nargout > 0) | |
82 retval = tmp; | |
83 endif | |
84 | |
85 endfunction | |
86 | |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
87 |
7189 | 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; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
90 %! colormap ('default'); |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
91 %! [x,y] = meshgrid (-1:0.1:1); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
92 %! z = sin (2*pi * sqrt (x.^2 + y.^2)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
93 %! theta = 2*pi * sqrt (x.^2 + y.^2) + pi/2; |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
11587
diff
changeset
|
94 %! quiver3 (x, y, z, sin (theta), cos (theta), ones (size (z))); |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
95 %! hold on; |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14359
diff
changeset
|
96 %! mesh (x, y, z); |
7189 | 97 %! hold off; |
7245 | 98 |
99 %!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
|
100 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
101 %! colormap ('default'); |
7245 | 102 %! [x, y, z] = peaks (25); |
103 %! surf (x, y, z); | |
104 %! hold on; | |
105 %! [u, v, w] = surfnorm (x, y, z / 10); | |
8056
9a6f4713f765
Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents:
7245
diff
changeset
|
106 %! h = quiver3 (x, y, z, u, v, w); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
107 %! set (h, 'maxheadsize', 0.33); |
8253
873ea2c72f16
quiver3.m: turn hold off after demo
John W. Eaton <jwe@octave.org>
parents:
8056
diff
changeset
|
108 %! hold off; |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8253
diff
changeset
|
109 |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8253
diff
changeset
|
110 %!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
|
111 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
112 %! colormap ('default'); |
14092
22c50cbad2ce
Add clf() to all plot demos.
Ben Abbott <bpabbott@mac.com>
parents:
14001
diff
changeset
|
113 %! [x, y, z] = peaks (25); |
22c50cbad2ce
Add clf() to all plot demos.
Ben Abbott <bpabbott@mac.com>
parents:
14001
diff
changeset
|
114 %! surf (x, y, z); |
22c50cbad2ce
Add clf() to all plot demos.
Ben Abbott <bpabbott@mac.com>
parents:
14001
diff
changeset
|
115 %! hold on; |
22c50cbad2ce
Add clf() to all plot demos.
Ben Abbott <bpabbott@mac.com>
parents:
14001
diff
changeset
|
116 %! [u, v, w] = surfnorm (x, y, z / 10); |
22c50cbad2ce
Add clf() to all plot demos.
Ben Abbott <bpabbott@mac.com>
parents:
14001
diff
changeset
|
117 %! h = quiver3 (x, y, z, u, v, w); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
118 %! set (h, 'maxheadsize', 0.33); |
14092
22c50cbad2ce
Add clf() to all plot demos.
Ben Abbott <bpabbott@mac.com>
parents:
14001
diff
changeset
|
119 %! hold off; |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
120 %! shading interp; |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8253
diff
changeset
|
121 |