annotate scripts/plot/appearance/clabel.m @ 27919:1891570abac8

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2020.
author John W. Eaton <jwe@octave.org>
date Mon, 06 Jan 2020 22:29:51 -0500
parents b442ec6dda5c
children bd51beb6205e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27919
1891570abac8 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27918
diff changeset
1 ## Copyright (C) 2008-2020 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
2 ##
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
3 ## See the file COPYRIGHT.md in the top-level directory of this distribution
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
4 ## or <https://octave.org/COPYRIGHT.html/>.
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
5 ##
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
6 ##
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
7 ## This file is part of Octave.
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
8 ##
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24478
diff changeset
9 ## Octave is free software: you can redistribute it and/or modify it
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
10 ## 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: 24478
diff changeset
11 ## 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
12 ## (at your option) any later version.
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
13 ##
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
14 ## Octave is distributed in the hope that it will be useful, but
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
15 ## WITHOUT ANY WARRANTY; without even the implied warranty of
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
17 ## GNU General Public License for more details.
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
18 ##
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
19 ## You should have received a copy of the GNU General Public License
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
20 ## 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: 24478
diff changeset
21 ## <https://www.gnu.org/licenses/>.
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
22
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
23 ## -*- texinfo -*-
20852
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19833
diff changeset
24 ## @deftypefn {} {} clabel (@var{c}, @var{h})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19833
diff changeset
25 ## @deftypefnx {} {} clabel (@var{c}, @var{h}, @var{v})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19833
diff changeset
26 ## @deftypefnx {} {} clabel (@var{c}, @var{h}, "manual")
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19833
diff changeset
27 ## @deftypefnx {} {} clabel (@var{c})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19833
diff changeset
28 ## @deftypefnx {} {} clabel (@dots{}, @var{prop}, @var{val}, @dots{})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19833
diff changeset
29 ## @deftypefnx {} {@var{h} =} clabel (@dots{})
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 14868
diff changeset
30 ## Add labels to the contours of a contour plot.
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 14868
diff changeset
31 ##
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 14868
diff changeset
32 ## The contour levels are specified by the contour matrix @var{c} which is
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 14868
diff changeset
33 ## returned by @code{contour}, @code{contourc}, @code{contourf}, and
19593
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
34 ## @code{contour3}. Contour labels are rotated to match the local line
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 14868
diff changeset
35 ## orientation and centered on the line. The position of labels along the
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 14868
diff changeset
36 ## contour line is chosen randomly.
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 14868
diff changeset
37 ##
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 14868
diff changeset
38 ## If the argument @var{h} is a handle to a contour group object, then label
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 14868
diff changeset
39 ## this plot rather than the one in the current axes returned by @code{gca}.
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
40 ##
9672
43a07df0ed4c document graphics structures
Michael D. Godfrey <godfrey@isl.stanford.edu>
parents: 9040
diff changeset
41 ## By default, all contours are labeled. However, the contours to label can be
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17190
diff changeset
42 ## specified by the vector @var{v}. If the @qcode{"manual"} argument is
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17190
diff changeset
43 ## given then the contours to label can be selected with the mouse.
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
44 ##
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
45 ## Additional property/value pairs that are valid properties of text objects
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 14868
diff changeset
46 ## can be given and are passed to the underlying text objects. Moreover,
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17190
diff changeset
47 ## the contour group property @qcode{"LabelSpacing"} is available which
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17190
diff changeset
48 ## determines the spacing between labels on a contour to be specified. The
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17190
diff changeset
49 ## default is 144 points, or 2 inches.
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
50 ##
14001
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 12575
diff changeset
51 ## The optional return value @var{h} is a vector of graphics handles to
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17190
diff changeset
52 ## the text objects representing each label.
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17190
diff changeset
53 ## The @qcode{"userdata"} property of the text objects contains the numerical
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17190
diff changeset
54 ## value of the contour label.
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
55 ##
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
56 ## An example of the use of @code{clabel} is
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
57 ##
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
58 ## @example
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
59 ## @group
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
60 ## [c, h] = contour (peaks (), -4 : 6);
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
61 ## clabel (c, h, -4:2:6, "fontsize", 12);
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
62 ## @end group
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
63 ## @end example
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
64 ##
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
65 ## @seealso{contour, contourf, contour3, meshc, surfc, text}
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
66 ## @end deftypefn
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
67
17470
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
68 function h = clabel (c, varargin)
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 14868
diff changeset
69
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
70 have_hg = false;
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
71 have_labelspacing = false;
17470
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
72 label_spacing = 144; # 2 inches in points
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
73
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
74 if (nargin < 1)
11589
b0084095098e missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
75 print_usage ();
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
76 elseif (nargin == 1)
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
77 hparent = gca ();
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
78 else
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
79 arg = varargin{1};
24478
59041be1994b Use new function isgraphics to simplify m-files.
Rik <rik@octave.org>
parents: 24423
diff changeset
80 if (isscalar (arg) && isgraphics (arg, "hggroup"))
17470
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
81 try
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
82 get (arg, "contourmatrix");
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
83 catch
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
84 error ("clabel: H must be a handle to a contour group");
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
85 end_try_catch
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
86 have_hg = true;
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
87 hg = arg;
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
88 varargin(1) = [];
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
89 else
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
90 hparent = gca ();
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
91 endif
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
92 endif
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
93
14868
5d3a684236b0 maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents: 14335
diff changeset
94 if (length (varargin) > 0 && isnumeric (varargin{1}))
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
95 v = varargin{1}(:);
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
96 varargin(1) = [];
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
97 else
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
98 v = [];
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
99 endif
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
100
17470
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
101 idx = strcmpi (varargin(1:2:end), "manual");
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
102 if (any (idx))
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
103 error ('clabel: "manual" contour mode is not supported');
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
104 endif
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
105
17470
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
106 idx = find (strcmpi (varargin(1:2:end), "labelspacing"), 1);
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
107 if (! isempty (idx))
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
108 have_labelspacing = true;
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
109 label_spacing = varargin{2*idx};
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
110 varargin(2*idx+(-1:0)) = [];
19593
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
111 endif
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
112
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
113 if (have_hg)
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
114 if (! isempty (v))
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
115 if (have_labelspacing)
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
116 set (hg, "textlistmode", "manual", "textlist", v,
17470
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
117 "labelspacing", label_spacing, "showtext", "on");
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
118 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9672
diff changeset
119 set (hg, "textlistmode", "manual", "textlist", v, "showtext", "on");
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
120 endif
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
121 else
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
122 if (have_labelspacing)
17470
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
123 set (hg, "showtext", "on", "labelspacing", label_spacing);
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
124 else
17470
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
125 set (hg, "showtext", "on");
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
126 endif
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
127 endif
17470
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
128 htmp = findobj (hg, "type", "text");
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
129 if (! isempty (varargin))
17470
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
130 set (htmp, varargin{:});
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
131 endif
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
132 else
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
133 htmp = __clabel__ (c, v, hparent, label_spacing, [], varargin{:});
17470
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
134 endif
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
135
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
136 if (nargout > 0)
576cf0589c6d Overhaul contour labeling functions.
Rik <rik@octave.org>
parents: 17281
diff changeset
137 h = htmp;
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
138 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
139
8289
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
140 endfunction
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
141
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
142
ac7f334d9652 Add contour group objects and the clabel function
David Bateman <dbateman@free.fr>
parents:
diff changeset
143 %!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
144 %! clf;
22302
1c4cd12987f5 Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents: 20852
diff changeset
145 %! 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
146 %! [c, h] = contour (peaks (), -4:6);
22302
1c4cd12987f5 Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents: 20852
diff changeset
147 %! clabel (c, h, -4:2:6, "fontsize", 12);
1c4cd12987f5 Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents: 20852
diff changeset
148 %! title ("clabel() labeling every other contour");
14001
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 12575
diff changeset
149
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 12575
diff changeset
150 %!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
151 %! clf;
22302
1c4cd12987f5 Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents: 20852
diff changeset
152 %! 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
153 %! [c, h] = contourf (peaks (), -7:6);
22302
1c4cd12987f5 Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents: 20852
diff changeset
154 %! clabel (c, h, -6:2:6, "fontsize", 12);
1c4cd12987f5 Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents: 20852
diff changeset
155 %! title ("clabel() labeling every other contour");