annotate scripts/plot/colorbar.m @ 9297:0d9f925b9705

colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
author Ben Abbott <bpabbott@mac.com>
date Wed, 03 Jun 2009 10:54:36 -0400
parents 02b16eeb3167
children 2884758e265b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8920
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8892
diff changeset
1 ## Copyright (C) 2008, 2009 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})
8507
cadc73247d65 style fixes
John W. Eaton <jwe@octave.org>
parents: 8236
diff changeset
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
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
8507
cadc73247d65 style fixes
John W. Eaton <jwe@octave.org>
parents: 8236
diff changeset
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
cadc73247d65 style fixes
John W. Eaton <jwe@octave.org>
parents: 8236
diff changeset
27 ## @item "East"
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
28 ## Place the colorbar inside the plot to the right.
8507
cadc73247d65 style fixes
John W. Eaton <jwe@octave.org>
parents: 8236
diff changeset
29 ## @item "WestOutside"
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
30 ## Place the colorbar outside the plot to the left.
8507
cadc73247d65 style fixes
John W. Eaton <jwe@octave.org>
parents: 8236
diff changeset
31 ## @item "West"
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
32 ## Place the colorbar inside the plot to the left.
8507
cadc73247d65 style fixes
John W. Eaton <jwe@octave.org>
parents: 8236
diff changeset
33 ## @item "NorthOutside"
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
34 ## Place the colorbar above the plot.
8507
cadc73247d65 style fixes
John W. Eaton <jwe@octave.org>
parents: 8236
diff changeset
35 ## @item "North"
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
36 ## Place the colorbar at the top of the plot.
8507
cadc73247d65 style fixes
John W. Eaton <jwe@octave.org>
parents: 8236
diff changeset
37 ## @item "SouthOutside"
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
38 ## Place the colorbar under the plot.
8507
cadc73247d65 style fixes
John W. Eaton <jwe@octave.org>
parents: 8236
diff changeset
39 ## @item "South"
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
40 ## Place the colorbar at the bottom of the plot.
8507
cadc73247d65 style fixes
John W. Eaton <jwe@octave.org>
parents: 8236
diff changeset
41 ## @item "Off", "None"
7189
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 ##
8507
cadc73247d65 style fixes
John W. Eaton <jwe@octave.org>
parents: 8236
diff changeset
45 ## If the argument "peer" is given, then the following argument is treated
7264
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
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
49 function h = colorbar (varargin)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
50 ax = [];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
51 loc = "eastoutside";
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
52 args = {};
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
53 deleting = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
54
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
55 i = 1;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
56 while (i <= nargin)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
57 arg = varargin {i++};
8101
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
58
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
59 if (ischar(arg))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
60 if (strcmpi (arg, "peer"))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
61 if (i > nargin)
8507
cadc73247d65 style fixes
John W. Eaton <jwe@octave.org>
parents: 8236
diff changeset
62 error ("colorbar: missing axes handle after \"peer\"");
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
63 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
64 ax = vargin{i++}
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
65 if (!isscalar (ax) || ! ishandle (ax)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
66 || strcmp (get (ax, "type"), "axes"))
8507
cadc73247d65 style fixes
John W. Eaton <jwe@octave.org>
parents: 8236
diff changeset
67 error ("colorbar: expecting an axes handle following \"peer\"");
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
68 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
75 elseif (strcmpi (arg, "off") || strcmpi (arg, "none"))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
76 deleting = true;
8101
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
77 else
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
78 args{end+1} = arg;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
79 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
80 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
81 args{end+1} = arg;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
82 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
83 endwhile
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
84
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
85 if (isempty (ax))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
86 ax = gca ();
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
87 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
102 position = obj.position;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
103 clen = rows (get (get (ax, "parent"), "colormap"));
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
104 cext = get (ax, "clim");
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
105 cdiff = (cext(2) - cext(1)) / clen / 2;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
106 cmin = cext(1) + cdiff;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
107 cmax = cext(2) - cdiff;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
108
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
109 orig_pos = obj.position;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
110 orig_opos = obj.outerposition;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
111 [pos, cpos, vertical, mirror, aspect] = ...
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
112 __position_colorbox__ (loc, obj, ancestor (ax, "figure"));
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
113 set (ax, "activepositionproperty", "position", "position", pos);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
114
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
117 "activepositionproperty", "position",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
118 "position", cpos);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
119 addproperty ("location", cax, "radio",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
120 "eastoutside|east|westoutside|west|northoutside|north|southoutside|south",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
121 loc);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
122 addproperty ("axes", cax, "handle", ax);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
123
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
124 if (vertical)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
125 hi = image (cax, [0,1], [cmin, cmax], [1 : clen]');
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
126 if (mirror)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
127 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
128 "ylim", cext, "ylimmode", "manual",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
129 "yaxislocation", "right", args{:});
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
130 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
131 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
132 "ylim", cext, "ylimmode", "manual",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
136 hi = image (cax, [cmin, cmax], [0,1], [1 : clen]);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
137 if (mirror)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
138 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
139 "xlim", cext, "xlimmode", "manual",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
140 "xaxislocation", "top", args{:});
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
141 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
142 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
143 "xlim", cext, "xlimmode", "manual",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
144 "xaxislocation", "bottom", args{:});
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
145 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
146 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
147
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
148 if (! isnan (aspect))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
149 set (cax, "dataaspectratio", aspect);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
150 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
151
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
152 ctext = text (0, 0, "", "tag", "colorbar","visible", "off",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
153 "handlevisibility", "off", "xliminclude", "off",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
154 "yliminclude", "off", "zliminclude", "off",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
155 "deletefcn", {@deletecolorbar, cax, orig_pos, orig_opos});
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
156
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
157 set (cax, "deletefcn", {@resetaxis, orig_pos, orig_opos});
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
158
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
159 addlistener (ax, "clim", {@update_colorbar_clim, hi, vertical})
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
160 addlistener (ax, "dataaspectratio", {@update_colorbar_axis, cax})
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
161 addlistener (ax, "position", {@update_colorbar_axis, cax})
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
162
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
163 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
164
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
165 if (nargout > 0)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
166 h = cax;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
167 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
168 endfunction
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
169
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
170 function deletecolorbar (h, d, hc, pos, opos)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
171 ## Don't delete the colorbar and reset the axis size if the
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
172 ## parent figure is being deleted.
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
173 if (ishandle (hc) && strcmp (get (hc, "type"), "axes") &&
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
174 (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off")))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
175 if (strcmp (get (hc, "beingdeleted"), "off"))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
176 delete (hc);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
177 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
178 if (!isempty (ancestor (h, "axes")) &&
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
179 strcmp (get (ancestor (h, "axes"), "beingdeleted"), "off"))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
180 set (ancestor (h, "axes"), "position", pos, "outerposition", opos);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
181 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
182 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
183 endfunction
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
184
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
185 function resetaxis (h, d, pos, opos)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
186 if (ishandle (h) && strcmp (get (h, "type"), "axes") &&
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
187 (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off")) &&
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
190 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
191 endfunction
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
192
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
193 function update_colorbar_clim (h, d, hi, vert)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
194 if (ishandle (h) && strcmp (get (h, "type"), "image") &&
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
195 (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off")))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
196 clen = rows (get (get (h, "parent"), "colormap"));
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
197 cext = get (h, "clim");
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
198 cdiff = (cext(2) - cext(1)) / clen / 2;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
199 cmin = cext(1) + cdiff;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
200 cmax = cext(2) - cdiff;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
201
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
202 if (vert)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
203 set (hi, "ydata", [cmin, cmax]);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
204 set (get (hi, "parent"), "ylim", cext);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
205 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
206 set (hi, "xdata", [cmin, cmax]);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
207 set (get (hi, "parent"), "xlim", cext);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
208 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
209 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
210 endfunction
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
211
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
212 function update_colorbar_axis (h, d, cax)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
213 if (ishandle (cax) && strcmp (get (cax, "type"), "axes") &&
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
214 (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off")))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
215 loc = get (cax, "location");
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
216 obj = get (h);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
217 [pos, cpos, vertical, mirror, aspect] = ...
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
218 __position_colorbox__ (loc, obj, ancestor (h, "figure"));
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
219
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
220 if (vertical)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
221 if (mirror)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
222 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
223 "yaxislocation", "right", "position", cpos);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
224 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
225 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
226 "yaxislocation", "left", "position", cpos);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
227 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
228 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
229 if (mirror)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
230 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
231 "xaxislocation", "top", "position", cpos);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
232 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
233 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal",
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
234 "xaxislocation", "bottom", "position", cpos);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
235 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
236 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
237
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
238 if (! isnan (aspect))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
239 set (cax, "dataaspectratio", aspect);
8101
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
240 endif
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
241 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
242 endfunction
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
243
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
244 function [pos, cpos, vertical, mirr, aspect] = __position_colorbox__ (cbox, obj, cf)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
245
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
246 pos = obj.position;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
247 sz = pos(3:4);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
248
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
249 off = 0;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
250 if (strcmpi (obj.dataaspectratiomode, "manual"))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
251 r = obj.dataaspectratio;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
252 if (pos(3) > pos(4))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
253 switch (cbox)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
254 case {"east", "eastoutside", "west", "westoutside"}
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
255 off = [(pos(3) - pos(4)) ./ (r(2) / r(1)), 0];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
256 endswitch
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
257 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
258 switch (cbox)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
259 case {"north", "northoutside", "south", "southoutside"}
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
260 off = [0, (pos(4) - pos(3)) ./ (r(1) / r(2))];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
261 ## This shouldn't be here except that gnuplot doesn't have a
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
262 ## square window and so a square aspect ratio is not square.
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
263 ## The corrections are empirical.
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
264 if (strcmp (get (cf, "__backend__"), "gnuplot"))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
265 if (length (cbox) > 7 && strcmp (cbox(end-6:end),"outside"))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
266 off = off / 2;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
267 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
268 off = off / 1.7;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
269 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
270 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
271 endswitch
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
272 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
273 off = off / 2;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
274 endif
8101
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
275
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
276 switch (cbox)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
277 case "northoutside"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
278 origin = pos(1:2) + [0., 0.9] .* sz + [1, -1] .* off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
279 sz = sz .* [1.0, 0.06];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
280 pos(4) = 0.8 * pos(4);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
281 mirr = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
282 vertical = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
283 case "north"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
284 origin = pos(1:2) + [0.05, 0.9] .* sz + [1, -1] .* off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
285 sz = sz .* [1.0, 0.06] * 0.9;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
286 mirr = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
287 vertical = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
288 case "southoutside"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
289 origin = pos(1:2) + off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
290 sz = sz .* [1.0, 0.06];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
291 pos(2) = pos(2) + pos(4) * 0.2;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
292 pos(4) = 0.8 * pos(4);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
293 mirr = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
294 vertical = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
295 case "south"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
296 origin = pos(1:2) + [0.05, 0.05] .* sz + off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
297 sz = sz .* [1.0, 0.06] * 0.9;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
298 mirr = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
299 vertical = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
300 case "eastoutside"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
301 origin = pos(1:2) + [0.9, 0] .* sz + [-1, 1] .* off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
302 sz = sz .* [0.06, 1.0];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
303 pos(3) = 0.8 * pos(3);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
304 mirr = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
305 vertical = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
306 case "east"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
307 origin = pos(1:2) + [0.9, 0.05] .* sz + [-1, 1] .* off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
308 sz = sz .* [0.06, 1.0] * 0.9;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
309 mirr = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
310 vertical = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
311 case "westoutside"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
312 origin = pos(1:2) + off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
313 sz = sz .* [0.06, 1.0];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
314 pos(1) = pos(1) + pos(3) * 0.2;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
315 pos(3) = 0.8 * pos(3);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
316 mirr = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
317 vertical = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
318 case "west"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
319 origin = pos(1:2) + [0.05, 0.05] .* sz + off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
320 sz = sz .* [0.06, 1.0] .* 0.9;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
321 mirr = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
322 vertical = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
323 endswitch
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
324
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
325 cpos = [origin, sz];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
326
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
346 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
347 if (vertical)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
348 aspect = [1, 0.21, 1];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
349 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
350 aspect = [0.21, 1, 1];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
351 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
352 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
353 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
354 aspect = NaN;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
361 %! 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
362 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
363 %! colorbar();
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
364
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
367 %! 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
368 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
369 %! colorbar("westoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
370
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
373 %! 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
374 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
375 %! colorbar("northoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
376
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
379 %! 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
380 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
381 %! colorbar("southoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
382
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
390 %! subplot(2,2,1)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
391 %! contour(peaks())
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
392 %! colorbar("east");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
393 %! subplot(2,2,2)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
394 %! contour(peaks())
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
395 %! colorbar("west");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
396 %! subplot(2,2,3)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
397 %! contour(peaks())
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
398 %! colorbar("north");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
399 %! subplot(2,2,4)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
400 %! contour(peaks())
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
401 %! colorbar("south");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
402
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
405 %! 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
406 %! subplot(2,2,1)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
407 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
408 %! colorbar();
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
409 %! subplot(2,2,2)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
410 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
411 %! colorbar("westoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
412 %! subplot(2,2,3)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
413 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
414 %! colorbar("northoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
415 %! subplot(2,2,4)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
416 %! imagesc(x)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
417 %! colorbar("southoutside");
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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