Mercurial > hg > octave-lyh
annotate scripts/plot/colorbar.m @ 9502:69a57c59868c
compass.m, feather.m: simplify argument processing
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 06 Aug 2009 15:09:53 -0400 |
parents | 0d9f925b9705 |
children | 2884758e265b |
rev | line source |
---|---|
8920 | 1 ## Copyright (C) 2008, 2009 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 -*- | |
20 ## @deftypefn {Function File} {} colorbar (@var{s}) | |
8507 | 21 ## @deftypefnx {Function File} {} colorbar ("peer", @var{h}, @dots{}) |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
22 ## Adds a colorbar to the current axes. Valid values for @var{s} are |
7189 | 23 ## |
24 ## @table @asis | |
8507 | 25 ## @item "EastOutside" |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
26 ## Place the colorbar outside the plot to the right. This is the default. |
8507 | 27 ## @item "East" |
7189 | 28 ## Place the colorbar inside the plot to the right. |
8507 | 29 ## @item "WestOutside" |
7189 | 30 ## Place the colorbar outside the plot to the left. |
8507 | 31 ## @item "West" |
7189 | 32 ## Place the colorbar inside the plot to the left. |
8507 | 33 ## @item "NorthOutside" |
7189 | 34 ## Place the colorbar above the plot. |
8507 | 35 ## @item "North" |
7189 | 36 ## Place the colorbar at the top of the plot. |
8507 | 37 ## @item "SouthOutside" |
7189 | 38 ## Place the colorbar under the plot. |
8507 | 39 ## @item "South" |
7189 | 40 ## Place the colorbar at the bottom of the plot. |
8507 | 41 ## @item "Off", "None" |
7189 | 42 ## Remove any existing colorbar from the plot. |
43 ## @end table | |
44 ## | |
8507 | 45 ## If the argument "peer" is given, then the following argument is treated |
7264 | 46 ## as the axes handle on which to add the colorbar. |
7189 | 47 ## @end deftypefn |
48 | |
8208 | 49 function h = colorbar (varargin) |
50 ax = []; | |
51 loc = "eastoutside"; | |
52 args = {}; | |
53 deleting = false; | |
54 | |
55 i = 1; | |
56 while (i <= nargin) | |
57 arg = varargin {i++}; | |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
58 |
8208 | 59 if (ischar(arg)) |
60 if (strcmpi (arg, "peer")) | |
61 if (i > nargin) | |
8507 | 62 error ("colorbar: missing axes handle after \"peer\""); |
8208 | 63 else |
64 ax = vargin{i++} | |
65 if (!isscalar (ax) || ! ishandle (ax) | |
66 || strcmp (get (ax, "type"), "axes")) | |
8507 | 67 error ("colorbar: expecting an axes handle following \"peer\""); |
8208 | 68 endif |
69 endif | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8102
diff
changeset
|
70 elseif (strcmpi (arg, "north") || strcmpi (arg, "south") |
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8102
diff
changeset
|
71 || strcmpi (arg, "east") || strcmpi (arg, "west") |
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8102
diff
changeset
|
72 || strcmpi (arg, "northoutside") || strcmpi (arg, "southoutside") |
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8102
diff
changeset
|
73 || strcmpi (arg, "eastoutside") || strcmpi (arg, "westoutside")) |
9262
de255681c85f
colorbar: downcase location argument
John W. Eaton <jwe@octave.org>
parents:
9040
diff
changeset
|
74 loc = tolower (arg); |
8208 | 75 elseif (strcmpi (arg, "off") || strcmpi (arg, "none")) |
76 deleting = true; | |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
77 else |
8208 | 78 args{end+1} = arg; |
79 endif | |
80 else | |
81 args{end+1} = arg; | |
82 endif | |
83 endwhile | |
84 | |
85 if (isempty (ax)) | |
86 ax = gca (); | |
87 endif | |
88 | |
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
|
89 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
|
90 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
|
91 set (0, "showhiddenhandles", "on") |
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
|
92 cax = findobj (get (ax, "parent"), "tag", "colorbar", "type", "axes", "axes", ax); |
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
|
93 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
|
94 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
|
95 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
|
96 unwind_protect_cleanup |
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
|
97 set (0, "showhiddenhandles", 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
|
98 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
|
99 |
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
|
100 if (! deleting) |
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
|
101 obj = get (ax); |
8208 | 102 position = obj.position; |
103 clen = rows (get (get (ax, "parent"), "colormap")); | |
104 cext = get (ax, "clim"); | |
105 cdiff = (cext(2) - cext(1)) / clen / 2; | |
106 cmin = cext(1) + cdiff; | |
107 cmax = cext(2) - cdiff; | |
108 | |
109 orig_pos = obj.position; | |
110 orig_opos = obj.outerposition; | |
111 [pos, cpos, vertical, mirror, aspect] = ... | |
112 __position_colorbox__ (loc, obj, ancestor (ax, "figure")); | |
113 set (ax, "activepositionproperty", "position", "position", pos); | |
114 | |
115 cax = __go_axes__ (get (ax, "parent"), "tag", "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
|
116 "handlevisibility", "on", |
8208 | 117 "activepositionproperty", "position", |
118 "position", cpos); | |
119 addproperty ("location", cax, "radio", | |
120 "eastoutside|east|westoutside|west|northoutside|north|southoutside|south", | |
121 loc); | |
122 addproperty ("axes", cax, "handle", ax); | |
123 | |
124 if (vertical) | |
125 hi = image (cax, [0,1], [cmin, cmax], [1 : clen]'); | |
126 if (mirror) | |
127 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", | |
128 "ylim", cext, "ylimmode", "manual", | |
129 "yaxislocation", "right", args{:}); | |
130 else | |
131 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", | |
132 "ylim", cext, "ylimmode", "manual", | |
133 "yaxislocation", "left", args{:}); | |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
134 endif |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
135 else |
8208 | 136 hi = image (cax, [cmin, cmax], [0,1], [1 : clen]); |
137 if (mirror) | |
138 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", | |
139 "xlim", cext, "xlimmode", "manual", | |
140 "xaxislocation", "top", args{:}); | |
141 else | |
142 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", | |
143 "xlim", cext, "xlimmode", "manual", | |
144 "xaxislocation", "bottom", args{:}); | |
145 endif | |
146 endif | |
147 | |
148 if (! isnan (aspect)) | |
149 set (cax, "dataaspectratio", aspect); | |
150 endif | |
151 | |
152 ctext = text (0, 0, "", "tag", "colorbar","visible", "off", | |
153 "handlevisibility", "off", "xliminclude", "off", | |
154 "yliminclude", "off", "zliminclude", "off", | |
155 "deletefcn", {@deletecolorbar, cax, orig_pos, orig_opos}); | |
156 | |
157 set (cax, "deletefcn", {@resetaxis, orig_pos, orig_opos}); | |
158 | |
159 addlistener (ax, "clim", {@update_colorbar_clim, hi, vertical}) | |
160 addlistener (ax, "dataaspectratio", {@update_colorbar_axis, cax}) | |
161 addlistener (ax, "position", {@update_colorbar_axis, cax}) | |
162 | |
163 endif | |
164 | |
165 if (nargout > 0) | |
166 h = cax; | |
167 endif | |
168 endfunction | |
169 | |
170 function deletecolorbar (h, d, hc, pos, opos) | |
171 ## Don't delete the colorbar and reset the axis size if the | |
172 ## parent figure is being deleted. | |
173 if (ishandle (hc) && strcmp (get (hc, "type"), "axes") && | |
174 (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off"))) | |
175 if (strcmp (get (hc, "beingdeleted"), "off")) | |
176 delete (hc); | |
177 endif | |
178 if (!isempty (ancestor (h, "axes")) && | |
179 strcmp (get (ancestor (h, "axes"), "beingdeleted"), "off")) | |
180 set (ancestor (h, "axes"), "position", pos, "outerposition", opos); | |
181 endif | |
182 endif | |
183 endfunction | |
184 | |
185 function resetaxis (h, d, pos, opos) | |
186 if (ishandle (h) && strcmp (get (h, "type"), "axes") && | |
187 (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off")) && | |
188 ishandle (get (h, "axes"))) | |
8228
53dbbd331498
Preserve font and position properties when axes are replace in the handle code
David Bateman <dbateman@free.fr>
parents:
8208
diff
changeset
|
189 set (get (h, "axes"), "position", pos, "outerposition", opos); |
8208 | 190 endif |
191 endfunction | |
192 | |
193 function update_colorbar_clim (h, d, hi, vert) | |
194 if (ishandle (h) && strcmp (get (h, "type"), "image") && | |
195 (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off"))) | |
196 clen = rows (get (get (h, "parent"), "colormap")); | |
197 cext = get (h, "clim"); | |
198 cdiff = (cext(2) - cext(1)) / clen / 2; | |
199 cmin = cext(1) + cdiff; | |
200 cmax = cext(2) - cdiff; | |
201 | |
202 if (vert) | |
203 set (hi, "ydata", [cmin, cmax]); | |
204 set (get (hi, "parent"), "ylim", cext); | |
205 else | |
206 set (hi, "xdata", [cmin, cmax]); | |
207 set (get (hi, "parent"), "xlim", cext); | |
208 endif | |
209 endif | |
210 endfunction | |
211 | |
212 function update_colorbar_axis (h, d, cax) | |
213 if (ishandle (cax) && strcmp (get (cax, "type"), "axes") && | |
214 (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off"))) | |
215 loc = get (cax, "location"); | |
216 obj = get (h); | |
217 [pos, cpos, vertical, mirror, aspect] = ... | |
218 __position_colorbox__ (loc, obj, ancestor (h, "figure")); | |
219 | |
220 if (vertical) | |
221 if (mirror) | |
222 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", | |
223 "yaxislocation", "right", "position", cpos); | |
224 else | |
225 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", | |
226 "yaxislocation", "left", "position", cpos); | |
227 endif | |
228 else | |
229 if (mirror) | |
230 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", | |
231 "xaxislocation", "top", "position", cpos); | |
232 else | |
233 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", | |
234 "xaxislocation", "bottom", "position", cpos); | |
235 endif | |
236 endif | |
237 | |
238 if (! isnan (aspect)) | |
239 set (cax, "dataaspectratio", aspect); | |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
240 endif |
8208 | 241 endif |
242 endfunction | |
243 | |
244 function [pos, cpos, vertical, mirr, aspect] = __position_colorbox__ (cbox, obj, cf) | |
245 | |
246 pos = obj.position; | |
247 sz = pos(3:4); | |
248 | |
249 off = 0; | |
250 if (strcmpi (obj.dataaspectratiomode, "manual")) | |
251 r = obj.dataaspectratio; | |
252 if (pos(3) > pos(4)) | |
253 switch (cbox) | |
254 case {"east", "eastoutside", "west", "westoutside"} | |
255 off = [(pos(3) - pos(4)) ./ (r(2) / r(1)), 0]; | |
256 endswitch | |
257 else | |
258 switch (cbox) | |
259 case {"north", "northoutside", "south", "southoutside"} | |
260 off = [0, (pos(4) - pos(3)) ./ (r(1) / r(2))]; | |
261 ## This shouldn't be here except that gnuplot doesn't have a | |
262 ## square window and so a square aspect ratio is not square. | |
263 ## The corrections are empirical. | |
264 if (strcmp (get (cf, "__backend__"), "gnuplot")) | |
265 if (length (cbox) > 7 && strcmp (cbox(end-6:end),"outside")) | |
266 off = off / 2; | |
267 else | |
268 off = off / 1.7; | |
269 endif | |
270 endif | |
271 endswitch | |
272 endif | |
273 off = off / 2; | |
274 endif | |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
275 |
8208 | 276 switch (cbox) |
277 case "northoutside" | |
278 origin = pos(1:2) + [0., 0.9] .* sz + [1, -1] .* off; | |
279 sz = sz .* [1.0, 0.06]; | |
280 pos(4) = 0.8 * pos(4); | |
281 mirr = true; | |
282 vertical = false; | |
283 case "north" | |
284 origin = pos(1:2) + [0.05, 0.9] .* sz + [1, -1] .* off; | |
285 sz = sz .* [1.0, 0.06] * 0.9; | |
286 mirr = false; | |
287 vertical = false; | |
288 case "southoutside" | |
289 origin = pos(1:2) + off; | |
290 sz = sz .* [1.0, 0.06]; | |
291 pos(2) = pos(2) + pos(4) * 0.2; | |
292 pos(4) = 0.8 * pos(4); | |
293 mirr = false; | |
294 vertical = false; | |
295 case "south" | |
296 origin = pos(1:2) + [0.05, 0.05] .* sz + off; | |
297 sz = sz .* [1.0, 0.06] * 0.9; | |
298 mirr = true; | |
299 vertical = false; | |
300 case "eastoutside" | |
301 origin = pos(1:2) + [0.9, 0] .* sz + [-1, 1] .* off; | |
302 sz = sz .* [0.06, 1.0]; | |
303 pos(3) = 0.8 * pos(3); | |
304 mirr = true; | |
305 vertical = true; | |
306 case "east" | |
307 origin = pos(1:2) + [0.9, 0.05] .* sz + [-1, 1] .* off; | |
308 sz = sz .* [0.06, 1.0] * 0.9; | |
309 mirr = false; | |
310 vertical = true; | |
311 case "westoutside" | |
312 origin = pos(1:2) + off; | |
313 sz = sz .* [0.06, 1.0]; | |
314 pos(1) = pos(1) + pos(3) * 0.2; | |
315 pos(3) = 0.8 * pos(3); | |
316 mirr = false; | |
317 vertical = true; | |
318 case "west" | |
319 origin = pos(1:2) + [0.05, 0.05] .* sz + off; | |
320 sz = sz .* [0.06, 1.0] .* 0.9; | |
321 mirr = true; | |
322 vertical = true; | |
323 endswitch | |
324 | |
325 cpos = [origin, sz]; | |
326 | |
327 if (strcmpi (obj.dataaspectratiomode, "manual")) | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
328 if (__gnuplot_has_feature__ ("screen_coordinates_for_{lrtb}margin")) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
329 obj.position = pos; |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
330 actual_pos = __actual_axis_position__ (obj); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
331 if (strfind (cbox, "outside")) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
332 scale = 1.0; |
8208 | 333 else |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
334 scale = 0.9; |
8208 | 335 endif |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
336 if (sz(1) > sz(2)) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
337 dx = (1-scale)*actual_pos(3); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
338 cpos(1) = actual_pos(1) + dx/2; |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
339 cpos(3) = actual_pos(3) - dx; |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
340 else |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
341 dy = (1-scale)*actual_pos(4); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
342 cpos(2) = actual_pos(2) + dy/2; |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
343 cpos(4) = actual_pos(4) - dy; |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
344 endif |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
345 aspect = NaN; |
8208 | 346 else |
347 if (vertical) | |
348 aspect = [1, 0.21, 1]; | |
349 else | |
350 aspect = [0.21, 1, 1]; | |
351 endif | |
352 endif | |
353 else | |
354 aspect = NaN; | |
355 endif | |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
356 |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
357 endfunction |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
358 |
7189 | 359 %!demo |
8790
a013ff655ca4
Trivial changes to demos to produce a more pleasant output for octave+gnuplot+aquaterm.
Ben Abbott <bpabbott@mac.com>
parents:
8746
diff
changeset
|
360 %! clf |
7189 | 361 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
362 %! imagesc(x) | |
363 %! colorbar(); | |
364 | |
365 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
366 %! clf |
7189 | 367 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
368 %! imagesc(x) | |
369 %! colorbar("westoutside"); | |
370 | |
371 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
372 %! clf |
7189 | 373 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
374 %! imagesc(x) | |
375 %! colorbar("northoutside"); | |
376 | |
377 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
378 %! clf |
7189 | 379 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
380 %! imagesc(x) | |
381 %! colorbar("southoutside"); | |
382 | |
383 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
384 %! clf |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
385 %! contour(peaks()) |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
386 %! colorbar("west"); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
387 |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
388 %!demo |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
389 %! clf |
7189 | 390 %! subplot(2,2,1) |
391 %! contour(peaks()) | |
392 %! colorbar("east"); | |
393 %! subplot(2,2,2) | |
394 %! contour(peaks()) | |
395 %! colorbar("west"); | |
396 %! subplot(2,2,3) | |
397 %! contour(peaks()) | |
398 %! colorbar("north"); | |
399 %! subplot(2,2,4) | |
400 %! contour(peaks()) | |
401 %! colorbar("south"); | |
402 | |
403 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
404 %! clf |
7189 | 405 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
406 %! subplot(2,2,1) | |
407 %! imagesc(x) | |
408 %! colorbar(); | |
409 %! subplot(2,2,2) | |
410 %! imagesc(x) | |
411 %! colorbar("westoutside"); | |
412 %! subplot(2,2,3) | |
413 %! imagesc(x) | |
414 %! colorbar("northoutside"); | |
415 %! subplot(2,2,4) | |
416 %! imagesc(x) | |
417 %! colorbar("southoutside"); | |
418 | |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
419 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
420 %! clf |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
421 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
422 %! subplot(1,2,1) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
423 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
424 %! axis square; |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
425 %! colorbar(); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
426 %! subplot(1,2,2) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
427 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
428 %! axis square; |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
429 %! colorbar("westoutside"); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
430 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
431 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
432 %! clf |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
433 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
434 %! subplot(1,2,1) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
435 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
436 %! axis square; |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
437 %! colorbar("northoutside"); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
438 %! subplot(1,2,2) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
439 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
440 %! axis square; |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
441 %! colorbar("southoutside"); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
442 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
443 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
444 %! clf |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
445 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
446 %! subplot(2,1,1) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
447 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
448 %! axis square; |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
449 %! colorbar(); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
450 %! subplot(2,1,2) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
451 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
452 %! axis square; |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
453 %! colorbar("westoutside"); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
454 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
455 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
456 %! clf |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
457 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
458 %! subplot(2,1,1) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
459 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
460 %! axis square; |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
461 %! colorbar("northoutside"); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
462 %! subplot(2,1,2) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
463 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
464 %! axis square; |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
465 %! colorbar("southoutside"); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
466 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
467 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
468 %! clf |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
469 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
470 %! subplot(1,2,1) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
471 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
472 %! colorbar(); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
473 %! subplot(1,2,2) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
474 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
475 %! colorbar("westoutside"); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
476 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
477 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
478 %! clf |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
479 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
480 %! subplot(1,2,1) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
481 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
482 %! colorbar("northoutside"); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
483 %! subplot(1,2,2) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
484 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
485 %! colorbar("southoutside"); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
486 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
487 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
488 %! clf |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
489 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
490 %! subplot(2,1,1) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
491 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
492 %! colorbar(); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
493 %! subplot(2,1,2) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
494 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
495 %! colorbar("westoutside"); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
496 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
497 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
498 %! clf |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
499 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
500 %! subplot(2,1,1) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
501 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
502 %! colorbar("northoutside"); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
503 %! subplot(2,1,2) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
504 %! imagesc(x) |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
505 %! colorbar("southoutside"); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
506 |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
507 %!demo |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
508 %! clf |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
509 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
510 %! subplot(1,2,1) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
511 %! contour(x) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
512 %! axis square; |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
513 %! colorbar("east"); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
514 %! xlim ([1, 64]) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
515 %! ylim ([1, 64]) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
516 %! subplot(1,2,2) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
517 %! contour(x) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
518 %! colorbar("west"); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
519 %! xlim ([1, 64]) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
520 %! ylim ([1, 64]) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
521 |
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
|
522 %!demo |
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
|
523 %! clf |
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
|
524 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
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
|
525 %! contour (x) |
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
|
526 %! xlim ([1, 64]) |
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
|
527 %! ylim ([1, 64]) |
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
|
528 %! colorbar (); |
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
|
529 %! colorbar off |
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
|
530 |
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
|
531 %!demo |
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
|
532 %! clf |
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
|
533 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
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
|
534 %! contour (x) |
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
|
535 %! xlim ([1, 64]) |
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
|
536 %! ylim ([1, 64]) |
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
|
537 %! colorbar (); |
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
|
538 %! colorbar (); |
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
|
539 |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
540 %!demo |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
541 %! clf |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
542 %! imagesc (1./hilb(99)); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
543 %! h = colorbar; |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
544 %! set (h, 'yscale', 'log'); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
545 |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
546 %!demo |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
547 %! clf |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
548 %! imagesc (log10 (1 ./ hilb (99))); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
549 %! h = colorbar; |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
550 %! ytick = get(h, "ytick"); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
551 %! set (h, "yticklabel", sprintf ('10^{%g}|', ytick)); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
552 |
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
|
553 %!demo |
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
|
554 %! clf |
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
|
555 %! n=5;x=linspace(0,5,n);y=linspace(0,1,n); |
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
|
556 %! imagesc(1./hilb(n)); axis equal; colorbar |
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
|
557 |
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
|
558 %!demo |
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
|
559 %! clf |
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
|
560 %! n=5;x=linspace(0,5,n);y=linspace(0,1,n); |
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
|
561 %! imagesc(x,y,1./hilb(n)); axis equal; colorbar |
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
|
562 |
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
|
563 %!demo |
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
|
564 %! clf |
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
|
565 %! n=5;x=linspace(0,5,n);y=linspace(0,1,n); |
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
|
566 %! imagesc(y,x,1./hilb(n)); axis equal; colorbar |
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 ## This requires that the axes position be properly determined for "axes equal" |
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 |
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
|
569 %!demo |
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
|
570 %! clf |
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
|
571 %! axes |
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
|
572 %! colorbar |
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
|
573 %! hold on |
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
|
574 %! contour(peaks) |
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
|
575 %! hold off |
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
|
576 |
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
|
577 %!demo |
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
|
578 %! clf |
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
|
579 %! plot([0, 2]) |
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 %! colorbar ("east") |
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 %! axis square |
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
|
582 |
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
|
583 %!demo |
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
|
584 %! clf |
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
|
585 %! plot([0, 2]) |
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
|
586 %! colorbar ("eastoutside") |
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
|
587 %! axis square |
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
|
588 |
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
|
589 %!demo |
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
|
590 %! clf |
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
|
591 %! plot([0, 2]) |
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
|
592 %! colorbar ("east") |
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
|
593 %! axis equal |
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
|
594 |
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
|
595 %!demo |
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
|
596 %! clf |
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
|
597 %! plot([0, 2]) |
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
|
598 %! colorbar ("eastoutside") |
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
|
599 %! axis equal |