Mercurial > octave-nkf
annotate scripts/plot/draw/colorbar.m @ 20654:b65888ec820e draft default tip gccjit
dmalcom gcc jit import
author | Stefan Mahr <dac922@gmx.de> |
---|---|
date | Fri, 27 Feb 2015 16:59:36 +0100 |
parents | 83792dd9bcc1 |
children |
rev | line source |
---|---|
19731
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19630
diff
changeset
|
1 ## Copyright (C) 2008-2015 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 -*- | |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17096
diff
changeset
|
20 ## @deftypefn {Command} {} colorbar |
17096 | 21 ## @deftypefnx {Function File} {} colorbar (@var{loc}) |
22 ## @deftypefnx {Function File} {} colorbar (@var{delete_option}) | |
23 ## @deftypefnx {Function File} {} colorbar (@var{hcb}, @dots{}) | |
24 ## @deftypefnx {Function File} {} colorbar (@var{hax}, @dots{}) | |
25 ## @deftypefnx {Function File} {} colorbar (@dots{}, "peer", @var{hax}, @dots{}) | |
26 ## @deftypefnx {Function File} {} colorbar (@dots{}, "location", @var{loc}, @dots{}) | |
27 ## @deftypefnx {Function File} {} colorbar (@dots{}, @var{prop}, @var{val}, @dots{}) | |
28 ## @deftypefnx {Function File} {@var{h} =} colorbar (@dots{}) | |
29 ## Add a colorbar to the current axes. | |
30 ## | |
31 ## A colorbar displays the current colormap along with numerical rulings | |
32 ## so that the color scale can be interpreted. | |
33 ## | |
34 ## The optional input @var{loc} determines the location of the colorbar. | |
35 ## Valid values for @var{loc} are | |
7189 | 36 ## |
37 ## @table @asis | |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
38 ## @item @qcode{"EastOutside"} |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
39 ## Place the colorbar outside the plot to the right. This is the default. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
40 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
41 ## @item @qcode{"East"} |
7189 | 42 ## Place the colorbar inside the plot to the right. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
43 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
44 ## @item @qcode{"WestOutside"} |
7189 | 45 ## Place the colorbar outside the plot to the left. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
46 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
47 ## @item @qcode{"West"} |
7189 | 48 ## Place the colorbar inside the plot to the left. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
49 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
50 ## @item @qcode{"NorthOutside"} |
7189 | 51 ## Place the colorbar above the plot. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
52 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
53 ## @item @qcode{"North"} |
7189 | 54 ## Place the colorbar at the top of the plot. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
55 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
56 ## @item @qcode{"SouthOutside"} |
7189 | 57 ## Place the colorbar under the plot. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
58 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
59 ## @item @qcode{"South"} |
7189 | 60 ## Place the colorbar at the bottom of the plot. |
61 ## @end table | |
62 ## | |
17096 | 63 ## To remove a colorbar from a plot use any one of the following keywords for |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
64 ## the @var{delete_option}: @qcode{"delete"}, @qcode{"hide"}, @qcode{"off"}. |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
65 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
66 ## If the argument @qcode{"peer"} is given, then the following argument is |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
67 ## treated as the axes handle in which to add the colorbar. Alternatively, |
17096 | 68 ## If the first argument @var{hax} is an axes handle, then the colorbar is |
69 ## added to this axis, rather than the current axes returned by @code{gca}. | |
70 ## | |
71 ## If the first argument @var{hcb} is a handle to a colorbar object, then | |
72 ## operate on this colorbar directly. | |
73 ## | |
74 ## Additional property/value pairs are passed directly to the underlying axes | |
75 ## object. | |
76 ## | |
77 ## The optional return value @var{h} is a graphics handle to the created | |
78 ## colorbar object. | |
79 ## | |
80 ## Implementation Note: A colorbar is created as an additional axes to the | |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
81 ## current figure with the @qcode{"tag"} property set to @qcode{"colorbar"}. |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
82 ## The created axes object has the extra property @qcode{"location"} which |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
83 ## controls the positioning of the colorbar. |
17096 | 84 ## @seealso{colormap} |
7189 | 85 ## @end deftypefn |
86 | |
8208 | 87 function h = colorbar (varargin) |
17096 | 88 |
89 [hcb, varargin, nargin] = __plt_get_axis_arg__ ("colorbar", varargin{:}); | |
90 | |
91 if (hcb && ! strcmp (get (hcb, "tag"), "colorbar")) | |
92 ax = hcb; | |
93 hcb = []; | |
94 else | |
95 ax = []; | |
96 endif | |
97 loc = ""; | |
8208 | 98 args = {}; |
99 deleting = false; | |
100 | |
101 i = 1; | |
102 while (i <= nargin) | |
17096 | 103 arg = varargin{i++}; |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14846
diff
changeset
|
104 if (ischar (arg)) |
17096 | 105 switch (tolower (arg)) |
106 case "peer" | |
107 if (i > nargin) | |
108 error ('colorbar: missing axes handle after "peer"'); | |
109 else | |
110 ax = varargin{i++}; | |
17125
b5d6314314fc
Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
111 if (! isscalar (ax) && ! isaxes (ax)) |
17096 | 112 error ('colorbar: expecting an axes handle following "peer"'); |
113 endif | |
10549 | 114 endif |
17096 | 115 case {"north", "south", "east", "west", |
116 "northoutside", "southoutside", "eastoutside", "westoutside"} | |
117 loc = tolower (arg); | |
118 case "location" | |
119 if (i > nargin) | |
120 error ('colorbar: missing value after "location"'); | |
121 else | |
122 loc = tolower (varargin{i++}); | |
123 endif | |
124 case {"delete", "hide", "off", "none"} | |
125 deleting = true; | |
126 otherwise | |
127 args{end+1} = arg; | |
128 endswitch | |
8208 | 129 else |
130 args{end+1} = arg; | |
131 endif | |
132 endwhile | |
133 | |
17096 | 134 ## Handle changes to existing colorbar |
135 if (! isempty (hcb)) | |
136 if (deleting) | |
137 delete (hcb); | |
138 if (nargout > 0) | |
139 h = hcb; | |
140 endif | |
141 return; | |
142 else | |
143 ## FIXME: No listener on location property so have to re-create | |
144 ## colorbar whenever an option changes. | |
145 ## re-instate this code if listener is developed. | |
19867
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
146 ## if (! isempty (loc)) |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
147 ## set (hcb, "location", loc); |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
148 ## endif |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
149 ## if (! isempty (args)) |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
150 ## set (hcb, args{:}); |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
151 ## endif |
19915
f25fe5369022
Don't assume axes parent is a figure (bug #44394)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19867
diff
changeset
|
152 ax = get (ancestor (hcb, "figure"), "currrentaxes"); |
17096 | 153 endif |
154 endif | |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
155 |
17096 | 156 if (isempty (loc)) |
157 loc = "eastoutside"; | |
158 endif | |
8208 | 159 if (isempty (ax)) |
160 ax = gca (); | |
161 endif | |
162 | |
8892
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
163 showhiddenhandles = get (0, "showhiddenhandles"); |
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
164 unwind_protect |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
165 set (0, "showhiddenhandles", "on"); |
19915
f25fe5369022
Don't assume axes parent is a figure (bug #44394)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19867
diff
changeset
|
166 cax = findobj (ancestor (ax, "figure"), |
19867
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
167 "tag", "colorbar", "type", "axes", "axes", ax); |
8892
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
168 if (! isempty (cax)) |
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
169 delete (cax); |
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
170 endif |
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
171 unwind_protect_cleanup |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
172 set (0, "showhiddenhandles", showhiddenhandles); |
8892
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
173 end_unwind_protect |
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
174 |
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
175 if (! deleting) |
17096 | 176 ## FIXME: Matlab does not require the "position" property to be active. |
177 ## Is there a way to determine the plotbox position for the | |
178 ## gnuplot graphics toolkit with the outerposition is active? | |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
179 set (ax, "activepositionproperty", "position"); |
8892
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
180 obj = get (ax); |
17096 | 181 obj.__cbar_hax__ = ax; |
8208 | 182 position = obj.position; |
20216
aa36fb998a4d
maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents:
19915
diff
changeset
|
183 |
19915
f25fe5369022
Don't assume axes parent is a figure (bug #44394)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19867
diff
changeset
|
184 hpar = ancestor (ax, "figure"); |
17096 | 185 clen = rows (get (hpar, "colormap")); |
8208 | 186 cext = get (ax, "clim"); |
187 cdiff = (cext(2) - cext(1)) / clen / 2; | |
188 cmin = cext(1) + cdiff; | |
189 cmax = cext(2) - cdiff; | |
190 | |
19867
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
191 [pos, cpos, vertical, mirror] = ... |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
192 __position_colorbox__ (loc, obj, ancestor (ax, "figure")); |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
193 set (ax, "position", pos); |
8208 | 194 |
17096 | 195 cax = __go_axes__ (hpar, "tag", "colorbar", |
196 "handlevisibility", "on", | |
197 "activepositionproperty", "position", | |
198 "position", cpos); | |
8208 | 199 addproperty ("location", cax, "radio", |
10549 | 200 "eastoutside|east|westoutside|west|northoutside|north|southoutside|south", |
201 loc); | |
8208 | 202 addproperty ("axes", cax, "handle", ax); |
203 | |
204 if (vertical) | |
17703
4d8ddc44d1f2
colorbar.m: Avoid segfault in colorbar (bug #40308)
Rik <rik@octave.org>
parents:
17572
diff
changeset
|
205 ## Use low-level form to avoid calling newplot which changes axes |
4d8ddc44d1f2
colorbar.m: Avoid segfault in colorbar (bug #40308)
Rik <rik@octave.org>
parents:
17572
diff
changeset
|
206 hi = image (cax, "xdata", [0,1], "ydata", [cmin, cmax], |
4d8ddc44d1f2
colorbar.m: Avoid segfault in colorbar (bug #40308)
Rik <rik@octave.org>
parents:
17572
diff
changeset
|
207 "cdata", [1 : clen]'); |
8208 | 208 if (mirror) |
10549 | 209 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
17096 | 210 "ylim", cext, "ylimmode", "manual", |
18916 | 211 "yaxislocation", "right", "layer", "top", args{:}); |
8208 | 212 else |
10549 | 213 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
17096 | 214 "ylim", cext, "ylimmode", "manual", |
18916 | 215 "yaxislocation", "left", "layer", "top", args{:}); |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
216 endif |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
217 else |
17703
4d8ddc44d1f2
colorbar.m: Avoid segfault in colorbar (bug #40308)
Rik <rik@octave.org>
parents:
17572
diff
changeset
|
218 hi = image (cax, "xdata", [cmin, cmax], "ydata", [0,1], |
4d8ddc44d1f2
colorbar.m: Avoid segfault in colorbar (bug #40308)
Rik <rik@octave.org>
parents:
17572
diff
changeset
|
219 "cdata", [1 : clen]); |
8208 | 220 if (mirror) |
10549 | 221 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
17096 | 222 "xlim", cext, "xlimmode", "manual", |
18916 | 223 "xaxislocation", "top", "layer", "top", args{:}); |
8208 | 224 else |
10549 | 225 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
17096 | 226 "xlim", cext, "xlimmode", "manual", |
18916 | 227 "xaxislocation", "bottom", "layer", "top", args{:}); |
8208 | 228 endif |
229 endif | |
230 | |
17096 | 231 ## Dummy object placed in axis to delete colorbar when axis is deleted. |
232 ctext = text (0, 0, "", "tag", "colorbar", | |
233 "visible", "off", "handlevisibility", "off", | |
234 "xliminclude", "off", "yliminclude", "off", | |
235 "zliminclude", "off", | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
236 "deletefcn", {@deletecolorbar, cax, obj}); |
8208 | 237 |
14777
1230d5d58d2d
Fix segfault when replacing a colorbar axis. (Bug # 36576)
Ben Abbott <bpabbott@mac.com>
parents:
14363
diff
changeset
|
238 set (cax, "deletefcn", {@resetaxis, ax, obj}); |
8208 | 239 |
17096 | 240 addlistener (hpar, "colormap", {@update_colorbar_cmap, hi, vertical, clen}); |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
241 addlistener (ax, "clim", {@update_colorbar_clim, hi, vertical}); |
17096 | 242 addlistener (ax, "dataaspectratio", {@update_colorbar_axis, cax, obj}); |
243 addlistener (ax, "dataaspectratiomode", {@update_colorbar_axis, cax, obj}); | |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
244 addlistener (ax, "plotboxaspectratio", {@update_colorbar_axis, cax, obj}); |
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
245 addlistener (ax, "plotboxaspectratiomode", {@update_colorbar_axis, cax, obj}); |
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
246 addlistener (ax, "position", {@update_colorbar_axis, cax, obj}); |
8208 | 247 |
248 endif | |
249 | |
250 if (nargout > 0) | |
251 h = cax; | |
252 endif | |
17096 | 253 |
8208 | 254 endfunction |
255 | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
256 function deletecolorbar (h, d, hc, orig_props) |
8208 | 257 ## Don't delete the colorbar and reset the axis size if the |
258 ## parent figure is being deleted. | |
17125
b5d6314314fc
Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
259 if (isaxes (hc) |
17096 | 260 && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off"))) |
8208 | 261 if (strcmp (get (hc, "beingdeleted"), "off")) |
262 delete (hc); | |
263 endif | |
19867
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
264 if (! isempty (ancestor (h, "axes")) |
11149
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
265 && strcmp (get (ancestor (h, "axes"), "beingdeleted"), "off")) |
17096 | 266 ax = ancestor (h, "axes"); |
267 units = get (ax, "units"); | |
268 set (ax, "units", orig_props.units); | |
269 set (ancestor (h, "axes"), "position", orig_props.position, | |
270 "outerposition", orig_props.outerposition, | |
271 "activepositionproperty", orig_props.activepositionproperty); | |
272 set (ax, "units", units); | |
8208 | 273 endif |
274 endif | |
275 endfunction | |
276 | |
14777
1230d5d58d2d
Fix segfault when replacing a colorbar axis. (Bug # 36576)
Ben Abbott <bpabbott@mac.com>
parents:
14363
diff
changeset
|
277 function resetaxis (cax, d, ax, orig_props) |
17125
b5d6314314fc
Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
278 if (isaxes (ax)) |
17096 | 279 ## FIXME: Probably don't want to delete everyone's listeners on colormap. |
19915
f25fe5369022
Don't assume axes parent is a figure (bug #44394)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19867
diff
changeset
|
280 dellistener (ancestor (ax, "figure"), "colormap"); |
17096 | 281 dellistener (ax, "clim"); |
282 dellistener (ax, "dataaspectratio"); | |
283 dellistener (ax, "dataaspectratiomode"); | |
284 dellistener (ax, "plotboxaspectratio"); | |
285 dellistener (ax, "plotboxaspectratiomode"); | |
15202
f3b5cadfd6d5
fix missing semicolons in various .m files
John W. Eaton <jwe@octave.org>
parents:
14868
diff
changeset
|
286 dellistener (ax, "position"); |
17096 | 287 |
14777
1230d5d58d2d
Fix segfault when replacing a colorbar axis. (Bug # 36576)
Ben Abbott <bpabbott@mac.com>
parents:
14363
diff
changeset
|
288 units = get (ax, "units"); |
15202
f3b5cadfd6d5
fix missing semicolons in various .m files
John W. Eaton <jwe@octave.org>
parents:
14868
diff
changeset
|
289 set (ax, "units", orig_props.units); |
17096 | 290 set (ax, "position", orig_props.position, |
291 "outerposition", orig_props.outerposition, | |
14777
1230d5d58d2d
Fix segfault when replacing a colorbar axis. (Bug # 36576)
Ben Abbott <bpabbott@mac.com>
parents:
14363
diff
changeset
|
292 "activepositionproperty", orig_props.activepositionproperty); |
15202
f3b5cadfd6d5
fix missing semicolons in various .m files
John W. Eaton <jwe@octave.org>
parents:
14868
diff
changeset
|
293 set (ax, "units", units); |
8208 | 294 endif |
295 endfunction | |
296 | |
17096 | 297 function update_colorbar_clim (hax, d, hi, vert) |
17125
b5d6314314fc
Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
298 if (isaxes (hax) |
17096 | 299 && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off"))) |
19915
f25fe5369022
Don't assume axes parent is a figure (bug #44394)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19867
diff
changeset
|
300 clen = rows (get (ancestor (hax, "figure"), "colormap")); |
17096 | 301 cext = get (hax, "clim"); |
8208 | 302 cdiff = (cext(2) - cext(1)) / clen / 2; |
303 cmin = cext(1) + cdiff; | |
304 cmax = cext(2) - cdiff; | |
305 | |
17412 | 306 hiax = get (hi, "parent"); |
8208 | 307 if (vert) |
308 set (hi, "ydata", [cmin, cmax]); | |
17412 | 309 set (hiax, "ylim", cext); |
8208 | 310 else |
311 set (hi, "xdata", [cmin, cmax]); | |
17412 | 312 set (hiax, "xlim", cext); |
8208 | 313 endif |
314 endif | |
315 endfunction | |
316 | |
17096 | 317 function update_colorbar_cmap (hf, d, hi, vert, init_sz) |
318 persistent sz = init_sz; | |
319 | |
320 if (ishandle (hf) && strcmp (get (hf, "type"), "figure") | |
321 && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off"))) | |
322 clen = rows (get (hf, "colormap")); | |
323 if (clen != sz) | |
324 if (vert) | |
325 set (hi, "cdata", [1:clen]'); | |
326 else | |
327 set (hi, "cdata", [1:clen]); | |
328 endif | |
329 sz = clen; | |
330 ## Also update limits on axis or there will be white gaps | |
331 update_colorbar_clim (get (hi, "parent"), d, hi, vert); | |
332 endif | |
333 endif | |
334 endfunction | |
335 | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
336 function update_colorbar_axis (h, d, cax, orig_props) |
17125
b5d6314314fc
Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
337 if (isaxes (cax) |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14777
diff
changeset
|
338 && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"),"off"))) |
8208 | 339 loc = get (cax, "location"); |
340 obj = get (h); | |
17096 | 341 obj.__cbar_hax__ = h; |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
342 obj.position = orig_props.position; |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
343 obj.outerposition = orig_props.outerposition; |
19867
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
344 [pos, cpos, vertical, mirror] = ... |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
345 __position_colorbox__ (loc, obj, ancestor (h, "figure")); |
8208 | 346 |
347 if (vertical) | |
348 if (mirror) | |
10549 | 349 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
17096 | 350 "yaxislocation", "right", "position", cpos); |
8208 | 351 else |
10549 | 352 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
17096 | 353 "yaxislocation", "left", "position", cpos); |
8208 | 354 endif |
355 else | |
356 if (mirror) | |
10549 | 357 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
17096 | 358 "xaxislocation", "top", "position", cpos); |
8208 | 359 else |
10549 | 360 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
17096 | 361 "xaxislocation", "bottom", "position", cpos); |
8208 | 362 endif |
363 endif | |
364 | |
365 endif | |
366 endfunction | |
367 | |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
368 function [pos, cpos, vertical, mirr] = __position_colorbox__ (cbox, obj, cf) |
8208 | 369 |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
370 ## This will always represent the position prior to adding the colorbar. |
8208 | 371 pos = obj.position; |
372 sz = pos(3:4); | |
373 | |
17096 | 374 if (strcmp (obj.plotboxaspectratiomode, "manual") |
375 || strcmp (obj.dataaspectratiomode, "manual")) | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
376 if (isempty (strfind (cbox, "outside"))) |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
377 scale = 1.0; |
8208 | 378 else |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
379 scale = 0.8; |
8208 | 380 endif |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
381 if (isempty (strfind (cbox, "east")) && isempty (strfind (cbox, "west"))) |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
382 scale = [1, scale]; |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
383 else |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
384 scale = [scale, 1]; |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
385 endif |
11576
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
386 if (strcmp (get (cf, "__graphics_toolkit__"), "gnuplot") |
11001
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
387 && strcmp (obj.activepositionproperty, "outerposition")) |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
388 obj.outerposition = obj.outerposition .* [1, 1, scale]; |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
389 off = 0.5 * (obj.outerposition (3:4) - __actual_axis_position__ (obj)(3:4)); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
390 else |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
391 obj.position = obj.position .* [1, 1, scale]; |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
392 off = 0.5 * (obj.position (3:4) - __actual_axis_position__ (obj)(3:4)); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
393 endif |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
394 else |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
395 off = 0.0; |
8208 | 396 endif |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
397 |
8208 | 398 switch (cbox) |
399 case "northoutside" | |
400 origin = pos(1:2) + [0., 0.9] .* sz + [1, -1] .* off; | |
20266
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20216
diff
changeset
|
401 sz .*= [1.0, 0.06]; |
8208 | 402 pos(4) = 0.8 * pos(4); |
403 mirr = true; | |
404 vertical = false; | |
405 case "north" | |
406 origin = pos(1:2) + [0.05, 0.9] .* sz + [1, -1] .* off; | |
20266
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20216
diff
changeset
|
407 sz .*= [1.0, 0.06] * 0.9; |
8208 | 408 mirr = false; |
409 vertical = false; | |
410 case "southoutside" | |
411 origin = pos(1:2) + off; | |
20266
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20216
diff
changeset
|
412 sz .*= [1.0, 0.06]; |
8208 | 413 pos(2) = pos(2) + pos(4) * 0.2; |
414 pos(4) = 0.8 * pos(4); | |
415 mirr = false; | |
416 vertical = false; | |
417 case "south" | |
418 origin = pos(1:2) + [0.05, 0.05] .* sz + off; | |
20266
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20216
diff
changeset
|
419 sz .*= [1.0, 0.06] * 0.9; |
8208 | 420 mirr = true; |
421 vertical = false; | |
422 case "eastoutside" | |
423 origin = pos(1:2) + [0.9, 0] .* sz + [-1, 1] .* off; | |
20266
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20216
diff
changeset
|
424 sz .*= [0.06, 1.0]; |
8208 | 425 pos(3) = 0.8 * pos(3); |
426 mirr = true; | |
427 vertical = true; | |
428 case "east" | |
429 origin = pos(1:2) + [0.9, 0.05] .* sz + [-1, 1] .* off; | |
20266
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20216
diff
changeset
|
430 sz .*= [0.06, 1.0] * 0.9; |
8208 | 431 mirr = false; |
432 vertical = true; | |
433 case "westoutside" | |
434 origin = pos(1:2) + off; | |
20266
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20216
diff
changeset
|
435 sz .*= [0.06, 1.0]; |
8208 | 436 pos(1) = pos(1) + pos(3) * 0.2; |
437 pos(3) = 0.8 * pos(3); | |
438 mirr = false; | |
439 vertical = true; | |
440 case "west" | |
441 origin = pos(1:2) + [0.05, 0.05] .* sz + off; | |
20266
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20216
diff
changeset
|
442 sz .*= [0.06, 1.0] .* 0.9; |
8208 | 443 mirr = true; |
444 vertical = true; | |
445 endswitch | |
446 | |
447 cpos = [origin, sz]; | |
448 | |
17096 | 449 if (strcmp (obj.plotboxaspectratiomode, "manual") |
450 || strcmp (obj.dataaspectratiomode, "manual")) | |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
451 obj.position = pos; |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
452 actual_pos = __actual_axis_position__ (obj); |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
453 if (strfind (cbox, "outside")) |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
454 scale = 1.0; |
8208 | 455 else |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
456 scale = 0.9; |
8208 | 457 endif |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
458 if (sz(1) > sz(2)) |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
459 ## Ensure north or south colorbars are the proper length |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
460 dx = (1-scale)*actual_pos(3); |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
461 cpos(1) = actual_pos(1) + dx/2; |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
462 cpos(3) = actual_pos(3) - dx; |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
463 else |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
464 ## Ensure east or west colorbars are the proper height |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
465 dy = (1-scale)*actual_pos(4); |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
466 cpos(2) = actual_pos(2) + dy/2; |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
467 cpos(4) = actual_pos(4) - dy; |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
468 endif |
8208 | 469 endif |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
470 |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
471 endfunction |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
472 |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
473 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
474 %!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
|
475 %! 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
|
476 %! 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
|
477 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
478 %! imagesc (x); |
8892
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
479 %! colorbar (); |
17190
df4c4b7708a4
Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents:
17125
diff
changeset
|
480 %! title ('colorbar() example'); |
8892
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
481 |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
482 %!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
|
483 %! 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
|
484 %! 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
|
485 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
486 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
487 %! colorbar ('westoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
488 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
489 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
490 %! 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
|
491 %! 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
|
492 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
493 %! imagesc (x); |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14247
diff
changeset
|
494 %! colorbar ('peer', gca, 'northoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
495 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
496 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
497 %! 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
|
498 %! 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
|
499 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
500 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
501 %! colorbar ('southoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
502 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
503 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
504 %! 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
|
505 %! 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
|
506 %! contour (peaks ()); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
507 %! colorbar ('west'); |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
508 |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
509 %!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
|
510 %! 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
|
511 %! 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
|
512 %! subplot (2,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
513 %! contour (peaks ()); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
514 %! colorbar ('east'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
515 %! subplot (2,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
516 %! contour (peaks ()); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
517 %! colorbar ('west'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
518 %! subplot (2,2,3); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
519 %! contour (peaks ()); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
520 %! colorbar ('north'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
521 %! subplot (2,2,4); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
522 %! contour (peaks ()); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
523 %! colorbar ('south'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
524 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
525 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
526 %! 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
|
527 %! 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
|
528 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
529 %! subplot (2,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
530 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
531 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
532 %! subplot (2,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
533 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
534 %! colorbar ('westoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
535 %! subplot (2,2,3); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
536 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
537 %! colorbar ('northoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
538 %! subplot (2,2,4); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
539 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
540 %! colorbar ('southoutside'); |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
541 |
9297
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
542 %!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
|
543 %! 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
|
544 %! 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
|
545 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
546 %! subplot (1,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
547 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
548 %! axis square; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
549 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
550 %! subplot (1,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
551 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
552 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
553 %! colorbar ('westoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
554 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
555 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
556 %! 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
|
557 %! 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
|
558 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
559 %! subplot (1,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
560 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
561 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
562 %! colorbar ('northoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
563 %! subplot (1,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
564 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
565 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
566 %! colorbar ('southoutside'); |
9297
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
567 |
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
568 %!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
|
569 %! 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
|
570 %! 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
|
571 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
572 %! subplot (2,1,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
573 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
574 %! axis square; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
575 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
576 %! subplot (2,1,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
577 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
578 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
579 %! colorbar ('westoutside'); |
9297
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
580 |
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
581 %!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
|
582 %! 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
|
583 %! 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
|
584 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
585 %! subplot (2,1,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
586 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
587 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
588 %! colorbar ('northoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
589 %! subplot (2,1,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
590 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
591 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
592 %! colorbar ('southoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
593 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
594 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
595 %! 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
|
596 %! 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
|
597 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
598 %! subplot (1,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
599 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
600 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
601 %! subplot (1,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
602 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
603 %! colorbar ('westoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
604 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
605 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
606 %! 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
|
607 %! 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
|
608 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
609 %! subplot (1,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
610 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
611 %! colorbar ('northoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
612 %! subplot (1,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
613 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
614 %! colorbar ('southoutside'); |
9297
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
615 |
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
616 %!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
|
617 %! 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
|
618 %! 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
|
619 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
620 %! subplot (2,1,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
621 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
622 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
623 %! subplot (2,1,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
624 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
625 %! colorbar ('westoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
626 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
627 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
628 %! 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
|
629 %! 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
|
630 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
631 %! subplot (2,1,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
632 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
633 %! colorbar ('northoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
634 %! subplot (2,1,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
635 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
636 %! colorbar ('southoutside'); |
9297
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
637 |
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
638 %!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
|
639 %! 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
|
640 %! 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
|
641 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
642 %! subplot (1,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
643 %! contour (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
644 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
645 %! colorbar ('east'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
646 %! xlim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
647 %! ylim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
648 %! subplot (1,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
649 %! contour (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
650 %! colorbar ('west'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
651 %! xlim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
652 %! ylim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
653 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
654 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
655 %! 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
|
656 %! 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
|
657 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
658 %! contour (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
659 %! xlim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
660 %! ylim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
661 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
662 %! colorbar off; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
663 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
664 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
665 %! 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
|
666 %! 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
|
667 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
668 %! contour (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
669 %! xlim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
670 %! ylim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
671 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
672 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
673 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
674 %! 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
|
675 %! 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
|
676 %! imagesc (1 ./ hilb (99)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
677 %! h = colorbar (); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
678 %! set (h, 'yscale', 'log'); |
9297
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
679 |
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
680 %!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
|
681 %! 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
|
682 %! 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
|
683 %! imagesc (log10 (1 ./ hilb (99))); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
684 %! h = colorbar (); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
685 %! ytick = get (h, 'ytick'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
686 %! set (h, 'yticklabel', sprintf ('10^{%g}|', ytick)); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
687 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
688 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
689 %! 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
|
690 %! 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
|
691 %! n = 5; x = linspace (0,5,n); y = linspace (0,1,n); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
692 %! imagesc (1 ./ hilb (n)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
693 %! axis equal; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
694 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
695 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
696 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
697 %! 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
|
698 %! 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
|
699 %! n = 5; x = linspace (0,5,n); y = linspace (0,1,n); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
700 %! imagesc (x, y, 1 ./ hilb (n)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
701 %! axis equal; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
702 %! colorbar (); |
9297
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
703 |
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
704 %!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
|
705 %! 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
|
706 %! 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
|
707 %! n = 5; x = linspace (0,5,n); y = linspace (0,1,n); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
708 %! imagesc (y, x, 1 ./ hilb (n)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
709 %! axis equal; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
710 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
711 |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
712 ## This requires that the axes position be properly determined for 'axis equal' |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
713 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
714 %! 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
|
715 %! 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
|
716 %! axes; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
717 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
718 %! hold on; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
719 %! contour (peaks ()); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
720 %! hold off; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
721 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
722 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
723 %! 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
|
724 %! 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
|
725 %! plot ([0, 2]); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
726 %! colorbar ('east'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
727 %! axis square; |
10910
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
728 |
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
729 %!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
|
730 %! 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
|
731 %! 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
|
732 %! plot ([0, 2]); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
733 %! colorbar ('eastoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
734 %! axis square; |
9297
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
735 |
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
736 %!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
|
737 %! 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
|
738 %! 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
|
739 %! pcolor (peaks (20)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
740 %! shading interp; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
741 %! axis ('tight', 'square'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
742 %! colorbar (); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
743 #%! axes ('color','none','box','on','activepositionproperty','position'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
744 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
745 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
746 %! 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
|
747 %! 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
|
748 %! plot ([0, 2]); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
749 %! colorbar ('east'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
750 %! axis equal; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
751 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
752 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
753 %! 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
|
754 %! 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
|
755 %! plot ([0, 2]); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
756 %! colorbar ('eastoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
757 %! axis equal; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
758 |