Mercurial > hg > octave-max
comparison scripts/plot/compass.m @ 11587:c792872f8942
all script files: untabify and strip trailing whitespace
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Jan 2011 17:35:29 -0500 |
parents | fd0a3ac60b0e |
children | 5f0bb45e615c |
comparison
equal
deleted
inserted
replaced
11586:12df7854fa7c | 11587:c792872f8942 |
---|---|
22 ## @deftypefnx {Function File} {} compass (@dots{}, @var{style}) | 22 ## @deftypefnx {Function File} {} compass (@dots{}, @var{style}) |
23 ## @deftypefnx {Function File} {} compass (@var{h}, @dots{}) | 23 ## @deftypefnx {Function File} {} compass (@var{h}, @dots{}) |
24 ## @deftypefnx {Function File} {@var{h} =} compass (@dots{}) | 24 ## @deftypefnx {Function File} {@var{h} =} compass (@dots{}) |
25 ## | 25 ## |
26 ## Plot the @code{(@var{u}, @var{v})} components of a vector field emanating | 26 ## Plot the @code{(@var{u}, @var{v})} components of a vector field emanating |
27 ## from the origin of a polar plot. If a single complex argument @var{z} is | 27 ## from the origin of a polar plot. If a single complex argument @var{z} is |
28 ## given, then @code{@var{u} = real (@var{z})} and @code{@var{v} = imag | 28 ## given, then @code{@var{u} = real (@var{z})} and @code{@var{v} = imag |
29 ## (@var{z})}. | 29 ## (@var{z})}. |
30 ## | 30 ## |
31 ## The style to use for the plot can be defined with a line style @var{style} | 31 ## The style to use for the plot can be defined with a line style @var{style} |
32 ## in a similar manner to the line styles used with the @code{plot} command. | 32 ## in a similar manner to the line styles used with the @code{plot} command. |
33 ## | 33 ## |
34 ## The optional return value @var{h} provides a list of handles to the | 34 ## The optional return value @var{h} provides a list of handles to the |
35 ## the parts of the vector field (body, arrow and marker). | 35 ## the parts of the vector field (body, arrow and marker). |
36 ## | 36 ## |
37 ## @example | 37 ## @example |
38 ## @group | 38 ## @group |
39 ## a = toeplitz([1;randn(9,1)],[1,randn(1,9)]); | 39 ## a = toeplitz([1;randn(9,1)],[1,randn(1,9)]); |
79 else | 79 else |
80 error ("compass: unrecognized argument"); | 80 error ("compass: unrecognized argument"); |
81 endif | 81 endif |
82 endwhile | 82 endwhile |
83 | 83 |
84 ## Matlab draws compass plots, with the arrow head as one continous | 84 ## Matlab draws compass plots, with the arrow head as one continous |
85 ## line, and each arrow separately. This is completely different than | 85 ## line, and each arrow separately. This is completely different than |
86 ## quiver and quite ugly. | 86 ## quiver and quite ugly. |
87 n = length (u); | 87 n = length (u); |
88 xend = u; | 88 xend = u; |
89 xtmp = u .* (1 - arrowsize); | 89 xtmp = u .* (1 - arrowsize); |
90 yend = v; | 90 yend = v; |