annotate scripts/plot/colorbar.m @ 8190:73d6b71788c0

use case-insensitive comparison for graphics properties; misc style fixes
author John W. Eaton <jwe@octave.org>
date Mon, 06 Oct 2008 21:06:05 -0400
parents c066714ee5d5
children f6ca8ff51818
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8102
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
1 ## Copyright (C) 2007 David Bateman
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
2 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
3 ## This file is part of Octave.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
4 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
8 ## your option) any later version.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
9 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
13 ## General Public License for more details.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
14 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
18
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
19 ## -*- texinfo -*-
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
20 ## @deftypefn {Function File} {} colorbar (@var{s})
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
21 ## @deftypefnx {Function File} {} colorbar ('peer', @var{h}, @dots{})
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
22 ## Adds a colorbar to the current axes. Valid values for @var{s} are
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
23 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
24 ## @table @asis
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
25 ## @item 'EastOutside'
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
26 ## Place the colorbar outside the plot to the right. This is the default.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
27 ## @item 'East'
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
28 ## Place the colorbar inside the plot to the right.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
29 ## @item 'WestOutside'
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
30 ## Place the colorbar outside the plot to the left.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
31 ## @item 'West'
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
32 ## Place the colorbar inside the plot to the left.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
33 ## @item 'NorthOutside'
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
34 ## Place the colorbar above the plot.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
35 ## @item 'North'
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
36 ## Place the colorbar at the top of the plot.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
37 ## @item 'SouthOutside'
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
38 ## Place the colorbar under the plot.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
39 ## @item 'South'
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
40 ## Place the colorbar at the bottom of the plot.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
41 ## @item 'Off', 'None'
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
42 ## Remove any existing colorbar from the plot.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
43 ## @end table
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
44 ##
7264
fac10884ddd4 [project @ 2007-12-05 22:09:53 by jwe]
jwe
parents: 7208
diff changeset
45 ## If the argument 'peer' is given, then the following argument is treated
fac10884ddd4 [project @ 2007-12-05 22:09:53 by jwe]
jwe
parents: 7208
diff changeset
46 ## as the axes handle on which to add the colorbar.
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
47 ## @end deftypefn
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
48
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
49
8102
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
50 ## PKG_ADD: mark_as_command colorbar
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
51
8102
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
52 function colorbar (varargin)
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
53
8190
73d6b71788c0 use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents: 8102
diff changeset
54 if (nargin > 0 && strcmpi (varargin{1}, "peer"))
8102
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
55 if (nargin > 1)
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
56 ax = varargin{2};
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
57 if (!isscalar (ax) || ! ishandle (ax)
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
58 || strcmp (get (ax, "type"), "axes"))
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
59 error ("colorbar: expecting an axes handle following 'peer'");
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
60 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
61 else
8102
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
62 error ("colorbar: misisng axes handle after 'peer'");
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
63 endif
8102
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
64 else
8101
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
65 ax = gca ();
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
66 endif
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
67
8102
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
68 pos = "eastoutside";
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
69 for i = 1 : length (varargin)
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
70 arg = varargin{i};
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
71 if (length(arg) < 1)
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
72 pos = "eastoutside";
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
73 elseif (ischar (arg))
8190
73d6b71788c0 use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents: 8102
diff changeset
74 if (strcmpi (arg, "off") || strcmpi (arg, "none"))
8102
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
75 pos = "none";
8190
73d6b71788c0 use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents: 8102
diff changeset
76 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
77 || 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
78 || 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
79 || strcmpi (arg, "eastoutside") || strcmpi (arg, "westoutside"))
8102
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
80 pos = arg;
8101
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
81 else
8102
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
82 error ("colorbar: unrecognized position argument");
8101
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
83 endif
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
84 else
8102
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
85 error ("colorbar: expecting string arguments");
8101
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
86 endif
8102
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
87 endfor
8101
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
88
8102
c066714ee5d5 undo previous change
John W. Eaton <jwe@octave.org>
parents: 8101
diff changeset
89 set (ax, "__colorbar__", pos);
8101
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
90
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
91 endfunction
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
92
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
93
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
94 %!demo
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
95 %! hold off;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
96 %! close all;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
97 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.');
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
98 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
99 %! colorbar();
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
100
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
101 %!demo
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
102 %! hold off;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
103 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.');
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
104 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
105 %! colorbar("westoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
106
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
107 %!demo
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
108 %! hold off;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
109 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.');
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
110 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
111 %! colorbar("northoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
112
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
113 %!demo
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
114 %! hold off;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
115 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.');
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
116 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
117 %! colorbar("southoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
118
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
119 %!demo
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
120 %! hold off;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
121 %! subplot(2,2,1)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
122 %! contour(peaks())
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
123 %! colorbar("east");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
124 %! subplot(2,2,2)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
125 %! contour(peaks())
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
126 %! colorbar("west");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
127 %! subplot(2,2,3)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
128 %! contour(peaks())
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
129 %! colorbar("north");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
130 %! subplot(2,2,4)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
131 %! contour(peaks())
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
132 %! colorbar("south");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
133
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
134 %!demo
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
135 %! hold off;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
136 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.');
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
137 %! subplot(2,2,1)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
138 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
139 %! colorbar();
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
140 %! subplot(2,2,2)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
141 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
142 %! colorbar("westoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
143 %! subplot(2,2,3)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
144 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
145 %! colorbar("northoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
146 %! subplot(2,2,4)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
147 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
148 %! colorbar("southoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
149
7726
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
150 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
151 %! hold off;
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
152 %! 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
153 %! 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
154 %! 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
155 %! 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
156 %! colorbar();
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
157 %! 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
158 %! 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
159 %! 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
160 %! 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
161
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
162 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
163 %! hold off;
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
164 %! 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
165 %! 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
166 %! 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
167 %! 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
168 %! 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
169 %! 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
170 %! 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
171 %! 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
172 %! 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
173
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
174 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
175 %! hold off;
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
176 %! 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
177 %! 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
178 %! 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
179 %! 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
180 %! colorbar();
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
181 %! 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
182 %! 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
183 %! 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
184 %! 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
185
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
186 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
187 %! hold off;
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
188 %! 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
189 %! 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
190 %! 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
191 %! 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
192 %! 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
193 %! 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
194 %! 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
195 %! 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
196 %! 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
197
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
198 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
199 %! hold off;
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
200 %! 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
201 %! 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
202 %! 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
203 %! colorbar();
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
204 %! 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
205 %! 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
206 %! 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
207
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
208 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
209 %! hold off;
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
210 %! 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
211 %! 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
212 %! 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
213 %! 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
214 %! 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
215 %! 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
216 %! 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
217
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
218 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
219 %! hold off;
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
220 %! 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
221 %! 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
222 %! 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
223 %! colorbar();
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
224 %! 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
225 %! 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
226 %! 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
227
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
228 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
229 %! hold off;
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
230 %! 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
231 %! 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
232 %! 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
233 %! 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
234 %! 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
235 %! 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
236 %! 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
237
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
238