annotate scripts/plot/colorbar.m @ 7726:1b954fdaf4ff

Try to get the colorbar position right for manual aspect ratios as well
author David Bateman <dbateman@free.fr>
date Mon, 21 Apr 2008 11:03:39 -0400
parents fac10884ddd4
children 86955a1559c5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
1 ## Copyright (C) 2007 David Bateman
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
50 ## PKG_ADD: mark_as_command colorbar
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
51
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
52 function colorbar (varargin)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
53
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
54 if (nargin > 0 && strcmpi(varargin{1}, "peer"))
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
55 if (nargin > 1)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
56 ax = varargin{2};
7191
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
57 if (!isscalar (ax) || ! ishandle (ax)
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
58 || strcmp (get (ax, "type"), "axes"))
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
59 error ("colorbar: expecting an axes handle following 'peer'");
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
62 error ("colorbar: misisng axes handle after 'peer'");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
63 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
64 else
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
65 ax = gca ();
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
66 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
67
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
68 pos = "eastoutside";
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
69 for i = 1 : length (varargin)
7208
a730e47fda4d [project @ 2007-11-28 02:32:41 by jwe]
jwe
parents: 7191
diff changeset
70 arg = varargin{i};
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
71 if (length(arg) < 1)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
72 pos = "eastoutside";
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
73 elseif (ischar (arg))
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
74 arg = tolower (arg);
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
75 if (strcmp (arg, "off") || strcmp (arg, "none"))
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
76 pos = "none";
7191
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
77 elseif (strcmp (arg, "north") || strcmp (arg, "south")
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
78 || strcmp (arg, "east") || strcmp (arg, "west")
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
79 || strcmp (arg, "northoutside") || strcmp (arg, "southoutside")
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
80 || strcmp (arg, "eastoutside") || strcmp (arg, "westoutside"))
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
81 pos = arg;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
82 else
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
83 error ("colorbar: unrecognized position argument");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
84 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
85 else
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
86 error ("colorbar: expecting string arguments");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
87 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
88 endfor
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
89
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
90 set (ax, "__colorbar__", pos);
7191
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
91
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
92 endfunction
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
95 %!demo
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
96 %! hold off;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
97 %! close all;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
98 %! 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
99 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
100 %! colorbar();
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
101
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
102 %!demo
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
103 %! hold off;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
104 %! 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
105 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
106 %! colorbar("westoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
107
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
108 %!demo
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
109 %! hold off;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
110 %! 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
111 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
112 %! colorbar("northoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
113
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
114 %!demo
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
115 %! hold off;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
116 %! 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
117 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
118 %! colorbar("southoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
119
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
120 %!demo
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
121 %! hold off;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
122 %! subplot(2,2,1)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
123 %! contour(peaks())
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
124 %! colorbar("east");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
125 %! subplot(2,2,2)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
126 %! contour(peaks())
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
127 %! colorbar("west");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
128 %! subplot(2,2,3)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
129 %! contour(peaks())
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
130 %! colorbar("north");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
131 %! subplot(2,2,4)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
132 %! contour(peaks())
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
133 %! colorbar("south");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
134
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
135 %!demo
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
136 %! hold off;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
137 %! 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
138 %! subplot(2,2,1)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
139 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
140 %! colorbar();
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
141 %! subplot(2,2,2)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
142 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
143 %! colorbar("westoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
144 %! subplot(2,2,3)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
145 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
146 %! colorbar("northoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
147 %! subplot(2,2,4)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
148 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
149 %! colorbar("southoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
150
7726
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
151 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
152 %! 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
153 %! 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
154 %! 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
155 %! 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
156 %! 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
157 %! colorbar();
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
158 %! 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
159 %! 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
160 %! 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
161 %! 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
162
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
163 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
164 %! 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
165 %! 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
166 %! 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
167 %! 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
168 %! 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
169 %! 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
170 %! 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
171 %! 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
172 %! 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
173 %! 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
174
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
175 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
176 %! 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
177 %! 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
178 %! 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
179 %! 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
180 %! 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
181 %! colorbar();
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
182 %! 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
183 %! 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
184 %! 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
185 %! 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
186
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
187 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
188 %! 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
189 %! 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
190 %! 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
191 %! 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
192 %! 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
193 %! 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
194 %! 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
195 %! 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
196 %! 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
197 %! 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
198
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
199 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
200 %! 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
201 %! 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
202 %! 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
203 %! 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
204 %! colorbar();
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
205 %! 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
206 %! 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
207 %! 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
208
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
209 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
210 %! 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
211 %! 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
212 %! 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
213 %! 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
214 %! 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
215 %! 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
216 %! 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
217 %! 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
218
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
219 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
220 %! 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
221 %! 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
222 %! 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
223 %! 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
224 %! colorbar();
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
225 %! 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
226 %! 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
227 %! 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
228
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
229 %!demo
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
230 %! 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
231 %! 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
232 %! 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
233 %! 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
234 %! 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
235 %! 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
236 %! 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
237 %! 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
238
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
239