Mercurial > hg > octave-lyh
annotate scripts/plot/contour3.m @ 12462:e4dbfe3019b1
Use PCRE regular expressions throughout Octave.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 19 Feb 2011 18:21:58 -0800 |
parents | c792872f8942 |
children | 22c50cbad2ce |
rev | line source |
---|---|
11523 | 1 ## Copyright (C) 2007-2011 David BAteman |
7175 | 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} {} contour3 (@var{z}) |
7317 | 21 ## @deftypefnx {Function File} {} contour3 (@var{z}, @var{vn}) |
22 ## @deftypefnx {Function File} {} contour3 (@var{x}, @var{y}, @var{z}) | |
23 ## @deftypefnx {Function File} {} contour3 (@var{x}, @var{y}, @var{z}, @var{vn}) | |
24 ## @deftypefnx {Function File} {} contour3 (@dots{}, @var{style}) | |
25 ## @deftypefnx {Function File} {} contour3 (@var{h}, @dots{}) | |
7175 | 26 ## @deftypefnx {Function File} {[@var{c}, @var{h}] =} contour3 (@dots{}) |
27 ## Plot level curves (contour lines) of the matrix @var{z}, using the | |
28 ## contour matrix @var{c} computed by @code{contourc} from the same | |
29 ## arguments; see the latter for their interpretation. The contours are | |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
30 ## plotted at the Z level corresponding to their contour. The set of |
7175 | 31 ## contour levels, @var{c}, is only returned if requested. For example: |
32 ## | |
33 ## @example | |
34 ## @group | |
35 ## contour3 (peaks (19)); | |
36 ## hold on | |
8507 | 37 ## surface (peaks (19), "facecolor", "none", "EdgeColor", "black") |
7175 | 38 ## colormap hot |
39 ## @end group | |
40 ## @end example | |
41 ## | |
7317 | 42 ## The style to use for the plot can be defined with a line style @var{style} |
43 ## in a similar manner to the line styles used with the @code{plot} command. | |
44 ## Any markers defined by @var{style} are ignored. | |
45 ## | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
46 ## The optional input and output argument @var{h} allows an axis handle to |
7175 | 47 ## be passed to @code{contour} and the handles to the contour objects to be |
48 ## returned. | |
49 ## @seealso{contourc, patch, plot} | |
50 ## @end deftypefn | |
51 | |
52 function [c, h] = contour3 (varargin) | |
53 | |
7216 | 54 [xh, varargin, nargin] = __plt_get_axis_arg__ ("contour3", varargin{:}); |
55 | |
7215 | 56 oldh = gca (); |
57 unwind_protect | |
7216 | 58 axes (xh); |
7175 | 59 newplot (); |
8289
ac7f334d9652
Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
7317
diff
changeset
|
60 [ctmp, htmp] = __contour__ (xh, "auto", varargin{:}); |
7215 | 61 unwind_protect_cleanup |
62 axes (oldh); | |
63 end_unwind_protect | |
7175 | 64 |
65 if (! ishold ()) | |
11427
dc983f92e774
contour3.m: Grid on be default for 3D plots.
Ben Abbott <bpabbott@mac.com>
parents:
11307
diff
changeset
|
66 set (xh, "view", [-37.5, 30], |
dc983f92e774
contour3.m: Grid on be default for 3D plots.
Ben Abbott <bpabbott@mac.com>
parents:
11307
diff
changeset
|
67 "xgrid", "on", "ygrid", "on", "zgrid", "on"); |
7175 | 68 endif |
69 | |
70 if (nargout > 0) | |
71 c = ctmp; | |
8289
ac7f334d9652
Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
7317
diff
changeset
|
72 h = htmp; |
7175 | 73 endif |
74 | |
75 endfunction | |
7245 | 76 |
77 %!demo | |
78 %! contour3 (peaks (19)); | |
79 %! hold on | |
8507 | 80 %! surface (peaks (19), "facecolor", "none", "edgecolor", "black") |
7245 | 81 %! colormap hot |
11307
6ab93f01df07
contour3.m: Modify demo to avoid clipping mesh.
Ben Abbott <bpabbott@mac.com>
parents:
10793
diff
changeset
|
82 %! axis tight |
6ab93f01df07
contour3.m: Modify demo to avoid clipping mesh.
Ben Abbott <bpabbott@mac.com>
parents:
10793
diff
changeset
|
83 %! zlim auto |
7245 | 84 %! hold off |
11307
6ab93f01df07
contour3.m: Modify demo to avoid clipping mesh.
Ben Abbott <bpabbott@mac.com>
parents:
10793
diff
changeset
|
85 %! box off |