Mercurial > hg > octave-nkf
annotate scripts/plot/draw/pcolor.m @ 20407:2283dd03bf50
ginput.m: Don't hang if window is close while fcn active (bug #44897).
* ginput.m: Change closerequestfcn for figure to point to ginput_closerequestfcn.
* ginput.m (ginput_closerequestfcn): New callback routine. Stops collecting
data for ginput. Calls original closerequestfcn to shutdown window.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 15 May 2015 16:51:57 -0700 |
parents | f6c901a691d5 |
children |
rev | line source |
---|---|
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
1 ## Copyright (C) 2007-2015 Kai Habel |
7109 | 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:
9245
diff
changeset
|
20 ## @deftypefn {Function File} {} pcolor (@var{x}, @var{y}, @var{c}) |
7109 | 21 ## @deftypefnx {Function File} {} pcolor (@var{c}) |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
22 ## @deftypefnx {Function File} {} pcolor (@var{hax}, @dots{}) |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
23 ## @deftypefnx {Function File} {@var{h} =} pcolor (@dots{}) |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17121
diff
changeset
|
24 ## Produce a 2-D density plot. |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
25 ## |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
26 ## A @code{pcolor} plot draws rectangles with colors from the matrix @var{c} |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
27 ## over the two-dimensional region represented by the matrices @var{x} and |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
28 ## @var{y}. @var{x} and @var{y} are the coordinates of the mesh's vertices |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
29 ## and are typically the output of @code{meshgrid}. If @var{x} and @var{y} are |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
30 ## vectors, then a typical vertex is (@var{x}(j), @var{y}(i), @var{c}(i,j)). |
16816
12005245b645
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
31 ## Thus, columns of @var{c} correspond to different @var{x} values and rows |
12005245b645
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
16814
diff
changeset
|
32 ## of @var{c} correspond to different @var{y} values. |
8132
8139ddb83bc3
pcolor.m: Improve doc strings.
Ben Abbott <bpabbott@mac.com>
parents:
7337
diff
changeset
|
33 ## |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
34 ## The values in @var{c} are scaled to span the range of the current |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
35 ## colormap. Limits may be placed on the color axis by the command |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
36 ## @code{caxis}, or by setting the @code{clim} property of the parent axis. |
8132
8139ddb83bc3
pcolor.m: Improve doc strings.
Ben Abbott <bpabbott@mac.com>
parents:
7337
diff
changeset
|
37 ## |
8139ddb83bc3
pcolor.m: Improve doc strings.
Ben Abbott <bpabbott@mac.com>
parents:
7337
diff
changeset
|
38 ## The face color of each cell of the mesh is determined by interpolating |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
39 ## the values of @var{c} for each of the cell's vertices; Contrast this with |
8132
8139ddb83bc3
pcolor.m: Improve doc strings.
Ben Abbott <bpabbott@mac.com>
parents:
7337
diff
changeset
|
40 ## @code{imagesc} which renders one cell for each element of @var{c}. |
8139ddb83bc3
pcolor.m: Improve doc strings.
Ben Abbott <bpabbott@mac.com>
parents:
7337
diff
changeset
|
41 ## |
8139ddb83bc3
pcolor.m: Improve doc strings.
Ben Abbott <bpabbott@mac.com>
parents:
7337
diff
changeset
|
42 ## @code{shading} modifies an attribute determining the manner by which the |
8139ddb83bc3
pcolor.m: Improve doc strings.
Ben Abbott <bpabbott@mac.com>
parents:
7337
diff
changeset
|
43 ## face color of each cell is interpolated from the values of @var{c}, |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
44 ## and the visibility of the cells' edges. By default the attribute is |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
45 ## @qcode{"faceted"}, which renders a single color for each cell's face with |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
46 ## the edge visible. |
8132
8139ddb83bc3
pcolor.m: Improve doc strings.
Ben Abbott <bpabbott@mac.com>
parents:
7337
diff
changeset
|
47 ## |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17121
diff
changeset
|
48 ## If the first argument @var{hax} is an axes handle, then plot into this axis, |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17121
diff
changeset
|
49 ## rather than the current axes returned by @code{gca}. |
8132
8139ddb83bc3
pcolor.m: Improve doc strings.
Ben Abbott <bpabbott@mac.com>
parents:
7337
diff
changeset
|
50 ## |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
51 ## The optional return value @var{h} is a graphics handle to the created |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
52 ## surface object. |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
53 ## |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
54 ## @seealso{caxis, shading, meshgrid, contour, imagesc} |
7109 | 55 ## @end deftypefn |
56 | |
7110 | 57 ## Author: Kai Habel <kai.habel@gmx.de> |
7109 | 58 |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
59 function h = pcolor (varargin) |
7109 | 60 |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
61 [hax, varargin, nargin] = __plt_get_axis_arg__ ("pcolor", varargin{:}); |
7109 | 62 |
63 if (nargin == 1) | |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
64 c = varargin{1}; |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14247
diff
changeset
|
65 [nr, nc] = size (c); |
17604
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
66 x = 1:nc; |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
67 y = 1:nr; |
7337 | 68 z = zeros (nr, nc); |
7109 | 69 elseif (nargin == 3) |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
70 x = varargin{1}; |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
71 y = varargin{2}; |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
72 c = varargin{3}; |
7110 | 73 z = zeros (size (c)); |
7109 | 74 else |
7110 | 75 print_usage (); |
76 endif | |
7109 | 77 |
17211
87ba70043bfc
Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
78 oldfig = []; |
17301
68bcac3c043a
Correct inversion accidentally introduced in cset 87ba70043bfc.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
79 if (! isempty (hax)) |
17211
87ba70043bfc
Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
80 oldfig = get (0, "currentfigure"); |
87ba70043bfc
Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
81 endif |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
82 unwind_protect |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
83 hax = newplot (hax); |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
84 htmp = surface (x, y, z, c); |
7109 | 85 |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
86 set (htmp, "facecolor", "flat"); |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
87 if (! ishold ()) |
17559
636330292685
pcolor.m: Only turn on axis box when ishold is false.
Rik <rik@octave.org>
parents:
17301
diff
changeset
|
88 set (hax, "view", [0, 90], "box", "on"); |
17603
dcbab6f3e727
pcolor.m: Use tight axis limits when x-values, y-values are integers.
Rik <rik@octave.org>
parents:
17572
diff
changeset
|
89 ## FIXME: Maybe this should be in the general axis limit setting routine? |
17604
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
90 ## When values are integers (such as from meshgrid), we want to |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
91 ## use tight limits for pcolor, mesh, surf, etc. Situation is |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
92 ## complicated immensely by vector or matrix input and meshgrid() |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
93 ## or ndgrid() format. |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
94 meshgrid_fmt = true; |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
95 if (isvector (x)) |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
96 xrng = x(isfinite (x)); |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
97 else |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
98 xrng = x(1, isfinite (x(1,:))); # meshgrid format (default) |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
99 if (all (xrng == xrng(1))) |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
100 xrng = x(isfinite (x(:,1)), 1); # ndgrid format |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
101 meshgrid_fmt = false; |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
102 endif |
17603
dcbab6f3e727
pcolor.m: Use tight axis limits when x-values, y-values are integers.
Rik <rik@octave.org>
parents:
17572
diff
changeset
|
103 endif |
17604
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
104 if (isvector (y)) |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
105 yrng = y(isfinite (y)); |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
106 else |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
107 if (meshgrid_fmt) |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
108 yrng = y(isfinite (y(:,1)), 1); |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
109 else |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
110 yrng = y(1, isfinite (y(1,:))); |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
111 endif |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
112 endif |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
113 if (all (xrng == fix (xrng))) |
20188
f6c901a691d5
pcolor.m: Stop error message from some non-meshgrid plots (bug #44615).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
114 xmin = min (xrng); |
f6c901a691d5
pcolor.m: Stop error message from some non-meshgrid plots (bug #44615).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
115 xmax = max (xrng); |
f6c901a691d5
pcolor.m: Stop error message from some non-meshgrid plots (bug #44615).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
116 if (xmin < xmax) |
f6c901a691d5
pcolor.m: Stop error message from some non-meshgrid plots (bug #44615).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
117 xlim ([xmin, xmax]); |
f6c901a691d5
pcolor.m: Stop error message from some non-meshgrid plots (bug #44615).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
118 endif |
17604
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
119 endif |
4975ccb0a916
pcolor.m: Calculate and apply axis limits for better plot appearance.
Rik <rik@octave.org>
parents:
17603
diff
changeset
|
120 if (all (yrng == fix (yrng))) |
20188
f6c901a691d5
pcolor.m: Stop error message from some non-meshgrid plots (bug #44615).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
121 ymin = min (yrng); |
f6c901a691d5
pcolor.m: Stop error message from some non-meshgrid plots (bug #44615).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
122 ymax = max (yrng); |
f6c901a691d5
pcolor.m: Stop error message from some non-meshgrid plots (bug #44615).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
123 if (ymin < ymax) |
f6c901a691d5
pcolor.m: Stop error message from some non-meshgrid plots (bug #44615).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
124 ylim ([ymin, ymax]); |
f6c901a691d5
pcolor.m: Stop error message from some non-meshgrid plots (bug #44615).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
125 endif |
17603
dcbab6f3e727
pcolor.m: Use tight axis limits when x-values, y-values are integers.
Rik <rik@octave.org>
parents:
17572
diff
changeset
|
126 endif |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
127 endif |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
128 |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
129 unwind_protect_cleanup |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
130 if (! isempty (oldfig)) |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
131 set (0, "currentfigure", oldfig); |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
132 endif |
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
133 end_unwind_protect |
7110 | 134 |
7109 | 135 if (nargout > 0) |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
136 h = htmp; |
7109 | 137 endif |
138 | |
139 endfunction | |
12817
e3e6079039c6
codesprint: 2 demos for pcolor.m dummy for surface.m
Kai Habel <kai.habel@gmx.de>
parents:
11587
diff
changeset
|
140 |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
141 |
12817
e3e6079039c6
codesprint: 2 demos for pcolor.m dummy for surface.m
Kai Habel <kai.habel@gmx.de>
parents:
11587
diff
changeset
|
142 %!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
|
143 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
144 %! colormap ('default'); |
17121
d4549655b92e
Rephrase %!tests to take advantage of single output form of peaks().
Rik <rik@octave.org>
parents:
17076
diff
changeset
|
145 %! Z = peaks (); |
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 %! pcolor (Z); |
17190
df4c4b7708a4
Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents:
17126
diff
changeset
|
147 %! title ('pcolor() of peaks with facet shading'); |
12817
e3e6079039c6
codesprint: 2 demos for pcolor.m dummy for surface.m
Kai Habel <kai.habel@gmx.de>
parents:
11587
diff
changeset
|
148 |
e3e6079039c6
codesprint: 2 demos for pcolor.m dummy for surface.m
Kai Habel <kai.habel@gmx.de>
parents:
11587
diff
changeset
|
149 %!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
|
150 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
151 %! 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
|
152 %! [X,Y,Z] = sombrero (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
153 %! [Fx,Fy] = gradient (Z); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
154 %! pcolor (X,Y,Fx+Fy); |
12817
e3e6079039c6
codesprint: 2 demos for pcolor.m dummy for surface.m
Kai Habel <kai.habel@gmx.de>
parents:
11587
diff
changeset
|
155 %! shading interp; |
17076
0de31fe43c4d
pcolor.m: Overhaul to use __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
16816
diff
changeset
|
156 %! axis tight; |
17190
df4c4b7708a4
Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents:
17126
diff
changeset
|
157 %! title ('pcolor() of peaks with interp shading'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
158 |