Mercurial > hg > octave-lyh
annotate scripts/plot/colorbar.m @ 14138:72c96de7a403 stable
maint: update copyright notices for 2012
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 02 Jan 2012 14:25:41 -0500 |
parents | d0b799dafede |
children | 11949c9795a0 |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
12575
diff
changeset
|
1 ## Copyright (C) 2008-2012 David Bateman |
7189 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
19 ## -*- texinfo -*- | |
10793
be55736a0783
Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents:
10558
diff
changeset
|
20 ## @deftypefn {Function File} {} colorbar (@var{s}) |
8507 | 21 ## @deftypefnx {Function File} {} colorbar ("peer", @var{h}, @dots{}) |
12575
d0b799dafede
Grammarcheck files for 3.4.1 release.
Rik <octave@nomad.inbox5.com>
parents:
12501
diff
changeset
|
22 ## Add a colorbar to the current axes. Valid values for @var{s} are |
7189 | 23 ## |
24 ## @table @asis | |
8507 | 25 ## @item "EastOutside" |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
26 ## Place the colorbar outside the plot to the right. This is the default. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
27 ## |
8507 | 28 ## @item "East" |
7189 | 29 ## Place the colorbar inside the plot to the right. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
30 ## |
8507 | 31 ## @item "WestOutside" |
7189 | 32 ## Place the colorbar outside the plot to the left. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
33 ## |
8507 | 34 ## @item "West" |
7189 | 35 ## Place the colorbar inside the plot to the left. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
36 ## |
8507 | 37 ## @item "NorthOutside" |
7189 | 38 ## Place the colorbar above the plot. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
39 ## |
8507 | 40 ## @item "North" |
7189 | 41 ## Place the colorbar at the top of the plot. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
42 ## |
8507 | 43 ## @item "SouthOutside" |
7189 | 44 ## Place the colorbar under the plot. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
45 ## |
8507 | 46 ## @item "South" |
7189 | 47 ## Place the colorbar at the bottom of the plot. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
48 ## |
8507 | 49 ## @item "Off", "None" |
7189 | 50 ## Remove any existing colorbar from the plot. |
51 ## @end table | |
52 ## | |
8507 | 53 ## If the argument "peer" is given, then the following argument is treated |
7264 | 54 ## as the axes handle on which to add the colorbar. |
7189 | 55 ## @end deftypefn |
56 | |
8208 | 57 function h = colorbar (varargin) |
58 ax = []; | |
59 loc = "eastoutside"; | |
60 args = {}; | |
61 deleting = false; | |
62 | |
63 i = 1; | |
64 while (i <= nargin) | |
65 arg = varargin {i++}; | |
66 if (ischar(arg)) | |
67 if (strcmpi (arg, "peer")) | |
10549 | 68 if (i > nargin) |
69 error ("colorbar: missing axes handle after \"peer\""); | |
70 else | |
71 ax = varargin{i++}; | |
72 if (!isscalar (ax) || ! ishandle (ax) | |
73 || ! strcmp (get (ax, "type"), "axes")) | |
74 error ("colorbar: expecting an axes handle following \"peer\""); | |
75 endif | |
76 endif | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8102
diff
changeset
|
77 elseif (strcmpi (arg, "north") || strcmpi (arg, "south") |
10549 | 78 || strcmpi (arg, "east") || strcmpi (arg, "west") |
79 || strcmpi (arg, "northoutside") || strcmpi (arg, "southoutside") | |
80 || strcmpi (arg, "eastoutside") || strcmpi (arg, "westoutside")) | |
81 loc = tolower (arg); | |
12501
5454b687fd14
colorbar.m: Allow location to be specified as a property.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
82 elseif (strcmpi (arg, "location") && i <= nargin) |
5454b687fd14
colorbar.m: Allow location to be specified as a property.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
83 loc = tolower (varargin{i++}); |
8208 | 84 elseif (strcmpi (arg, "off") || strcmpi (arg, "none")) |
10549 | 85 deleting = true; |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
86 else |
10549 | 87 args{end+1} = arg; |
8208 | 88 endif |
89 else | |
90 args{end+1} = arg; | |
91 endif | |
92 endwhile | |
93 | |
94 if (isempty (ax)) | |
95 ax = gca (); | |
96 endif | |
97 | |
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
|
98 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
|
99 unwind_protect |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
100 set (0, "showhiddenhandles", "on"); |
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
|
101 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
|
102 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
|
103 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
|
104 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
|
105 unwind_protect_cleanup |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
106 set (0, "showhiddenhandles", showhiddenhandles); |
8892
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
107 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
|
108 |
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
|
109 if (! deleting) |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
110 ## FIXME - Matlab does not require the "position" property to be active. |
11576
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
111 ## Is there a way to determine the plotbox position for the |
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
112 ## gnuplot graphics toolkit with the outerposition is active? |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
113 set (ax, "activepositionproperty", "position"); |
8892
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
114 obj = get (ax); |
10920
91ff0d7ee94b
Don't pass figure handle to __calc_dimensions__.
Ben Abbott <bpabbott@mac.com>
parents:
10910
diff
changeset
|
115 obj.__my_handle__ = ax; |
8208 | 116 position = obj.position; |
117 clen = rows (get (get (ax, "parent"), "colormap")); | |
118 cext = get (ax, "clim"); | |
119 cdiff = (cext(2) - cext(1)) / clen / 2; | |
120 cmin = cext(1) + cdiff; | |
121 cmax = cext(2) - cdiff; | |
122 | |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
123 [pos, cpos, vertical, mirror] = ... |
10549 | 124 __position_colorbox__ (loc, obj, ancestor (ax, "figure")); |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
125 set (ax, "position", pos); |
8208 | 126 |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
127 cax = __go_axes__ (get (ax, "parent"), "tag", "colorbar", |
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
128 "handlevisibility", "on", |
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
129 "activepositionproperty", "position", |
10549 | 130 "position", cpos); |
8208 | 131 addproperty ("location", cax, "radio", |
10549 | 132 "eastoutside|east|westoutside|west|northoutside|north|southoutside|south", |
133 loc); | |
8208 | 134 addproperty ("axes", cax, "handle", ax); |
135 | |
136 if (vertical) | |
137 hi = image (cax, [0,1], [cmin, cmax], [1 : clen]'); | |
138 if (mirror) | |
10549 | 139 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
140 "ylim", cext, "ylimmode", "manual", | |
141 "yaxislocation", "right", args{:}); | |
8208 | 142 else |
10549 | 143 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
144 "ylim", cext, "ylimmode", "manual", | |
145 "yaxislocation", "left", args{:}); | |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
146 endif |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
147 else |
8208 | 148 hi = image (cax, [cmin, cmax], [0,1], [1 : clen]); |
149 if (mirror) | |
10549 | 150 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
151 "xlim", cext, "xlimmode", "manual", | |
152 "xaxislocation", "top", args{:}); | |
8208 | 153 else |
10549 | 154 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
155 "xlim", cext, "xlimmode", "manual", | |
156 "xaxislocation", "bottom", args{:}); | |
8208 | 157 endif |
158 endif | |
159 | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
160 ctext = text (0, 0, "", "tag", "colorbar","visible", "off", |
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
161 "handlevisibility", "off", "xliminclude", "off", |
10549 | 162 "yliminclude", "off", "zliminclude", "off", |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
163 "deletefcn", {@deletecolorbar, cax, obj}); |
8208 | 164 |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
165 set (cax, "deletefcn", {@resetaxis, obj}); |
8208 | 166 |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
167 addlistener (ax, "clim", {@update_colorbar_clim, hi, vertical}); |
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
168 addlistener (ax, "plotboxaspectratio", {@update_colorbar_axis, cax, obj}); |
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
169 addlistener (ax, "plotboxaspectratiomode", {@update_colorbar_axis, cax, obj}); |
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
170 addlistener (ax, "dataaspectratio", {@update_colorbar_axis, cax, obj}); |
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
171 addlistener (ax, "dataaspectratiomode", {@update_colorbar_axis, cax, obj}); |
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
172 addlistener (ax, "position", {@update_colorbar_axis, cax, obj}); |
8208 | 173 |
174 endif | |
175 | |
176 if (nargout > 0) | |
177 h = cax; | |
178 endif | |
179 endfunction | |
180 | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
181 function deletecolorbar (h, d, hc, orig_props) |
8208 | 182 ## Don't delete the colorbar and reset the axis size if the |
183 ## parent figure is being deleted. | |
11149
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
184 if (ishandle (hc) && strcmp (get (hc, "type"), "axes") |
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
185 && (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off"))) |
8208 | 186 if (strcmp (get (hc, "beingdeleted"), "off")) |
187 delete (hc); | |
188 endif | |
11149
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
189 if (!isempty (ancestor (h, "axes")) |
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
190 && strcmp (get (ancestor (h, "axes"), "beingdeleted"), "off")) |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
191 set (ancestor (h, "axes"), "position", orig_props.position, ... |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
192 "outerposition", orig_props.outerposition, ... |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
193 "activepositionproperty", orig_props.activepositionproperty); |
8208 | 194 endif |
195 endif | |
196 endfunction | |
197 | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
198 function resetaxis (h, d, orig_props) |
11149
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
199 if (ishandle (h) && strcmp (get (h, "type"), "axes") |
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
200 && (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off")) |
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
201 && ishandle (get (h, "axes"))) |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
202 set (get (h, "axes"), "position", orig_props.position, ... |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
203 "outerposition", orig_props.outerposition, ... |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
204 "activepositionproperty", orig_props.activepositionproperty); |
8208 | 205 endif |
206 endfunction | |
207 | |
208 function update_colorbar_clim (h, d, hi, vert) | |
11149
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
209 if (ishandle (h) && strcmp (get (h, "type"), "image") |
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
210 && (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off"))) |
8208 | 211 clen = rows (get (get (h, "parent"), "colormap")); |
212 cext = get (h, "clim"); | |
213 cdiff = (cext(2) - cext(1)) / clen / 2; | |
214 cmin = cext(1) + cdiff; | |
215 cmax = cext(2) - cdiff; | |
216 | |
217 if (vert) | |
218 set (hi, "ydata", [cmin, cmax]); | |
219 set (get (hi, "parent"), "ylim", cext); | |
220 else | |
221 set (hi, "xdata", [cmin, cmax]); | |
222 set (get (hi, "parent"), "xlim", cext); | |
223 endif | |
224 endif | |
225 endfunction | |
226 | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
227 function update_colorbar_axis (h, d, cax, orig_props) |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
228 |
11149
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
229 if (ishandle (cax) && strcmp (get (cax, "type"), "axes") |
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
230 && (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off"))) |
8208 | 231 loc = get (cax, "location"); |
232 obj = get (h); | |
10920
91ff0d7ee94b
Don't pass figure handle to __calc_dimensions__.
Ben Abbott <bpabbott@mac.com>
parents:
10910
diff
changeset
|
233 obj.__my_handle__ = h; |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
234 obj.position = orig_props.position; |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
235 obj.outerposition = orig_props.outerposition; |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
236 [pos, cpos, vertical, mirror] = ... |
10549 | 237 __position_colorbox__ (loc, obj, ancestor (h, "figure")); |
8208 | 238 |
239 if (vertical) | |
240 if (mirror) | |
10549 | 241 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
242 "yaxislocation", "right", "position", cpos); | |
8208 | 243 else |
10549 | 244 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
245 "yaxislocation", "left", "position", cpos); | |
8208 | 246 endif |
247 else | |
248 if (mirror) | |
10549 | 249 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
250 "xaxislocation", "top", "position", cpos); | |
8208 | 251 else |
10549 | 252 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
253 "xaxislocation", "bottom", "position", cpos); | |
8208 | 254 endif |
255 endif | |
256 | |
257 endif | |
258 endfunction | |
259 | |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
260 function [pos, cpos, vertical, mirr] = __position_colorbox__ (cbox, obj, cf) |
8208 | 261 |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
262 ## This will always represent the position prior to adding the colorbar. |
8208 | 263 pos = obj.position; |
264 sz = pos(3:4); | |
265 | |
11197
836427db633b
Make colorbar function aware of dataaspect settings
Konstantinos Poulios <logari81@googlemail.com>
parents:
11149
diff
changeset
|
266 if (strcmpi (obj.plotboxaspectratiomode, "manual") |
836427db633b
Make colorbar function aware of dataaspect settings
Konstantinos Poulios <logari81@googlemail.com>
parents:
11149
diff
changeset
|
267 || strcmpi (obj.dataaspectratiomode, "manual")) |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
268 if (isempty (strfind (cbox, "outside"))) |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
269 scale = 1.0; |
8208 | 270 else |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
271 scale = 0.8; |
8208 | 272 endif |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
273 if (isempty (strfind (cbox, "east")) && isempty (strfind (cbox, "west"))) |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
274 scale = [1, scale]; |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
275 else |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
276 scale = [scale, 1]; |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
277 endif |
11576
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
278 if (strcmp (get (cf, "__graphics_toolkit__"), "gnuplot") |
11001
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
279 && strcmp (obj.activepositionproperty, "outerposition")) |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
280 obj.outerposition = obj.outerposition .* [1, 1, scale]; |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
281 off = 0.5 * (obj.outerposition (3:4) - __actual_axis_position__ (obj)(3:4)); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
282 else |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
283 obj.position = obj.position .* [1, 1, scale]; |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
284 off = 0.5 * (obj.position (3:4) - __actual_axis_position__ (obj)(3:4)); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
285 endif |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
286 else |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
287 off = 0.0; |
8208 | 288 endif |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
289 |
8208 | 290 switch (cbox) |
291 case "northoutside" | |
292 origin = pos(1:2) + [0., 0.9] .* sz + [1, -1] .* off; | |
293 sz = sz .* [1.0, 0.06]; | |
294 pos(4) = 0.8 * pos(4); | |
295 mirr = true; | |
296 vertical = false; | |
297 case "north" | |
298 origin = pos(1:2) + [0.05, 0.9] .* sz + [1, -1] .* off; | |
299 sz = sz .* [1.0, 0.06] * 0.9; | |
300 mirr = false; | |
301 vertical = false; | |
302 case "southoutside" | |
303 origin = pos(1:2) + off; | |
304 sz = sz .* [1.0, 0.06]; | |
305 pos(2) = pos(2) + pos(4) * 0.2; | |
306 pos(4) = 0.8 * pos(4); | |
307 mirr = false; | |
308 vertical = false; | |
309 case "south" | |
310 origin = pos(1:2) + [0.05, 0.05] .* sz + off; | |
311 sz = sz .* [1.0, 0.06] * 0.9; | |
312 mirr = true; | |
313 vertical = false; | |
314 case "eastoutside" | |
315 origin = pos(1:2) + [0.9, 0] .* sz + [-1, 1] .* off; | |
316 sz = sz .* [0.06, 1.0]; | |
317 pos(3) = 0.8 * pos(3); | |
318 mirr = true; | |
319 vertical = true; | |
320 case "east" | |
321 origin = pos(1:2) + [0.9, 0.05] .* sz + [-1, 1] .* off; | |
322 sz = sz .* [0.06, 1.0] * 0.9; | |
323 mirr = false; | |
324 vertical = true; | |
325 case "westoutside" | |
326 origin = pos(1:2) + off; | |
327 sz = sz .* [0.06, 1.0]; | |
328 pos(1) = pos(1) + pos(3) * 0.2; | |
329 pos(3) = 0.8 * pos(3); | |
330 mirr = false; | |
331 vertical = true; | |
332 case "west" | |
333 origin = pos(1:2) + [0.05, 0.05] .* sz + off; | |
334 sz = sz .* [0.06, 1.0] .* 0.9; | |
335 mirr = true; | |
336 vertical = true; | |
337 endswitch | |
338 | |
339 cpos = [origin, sz]; | |
340 | |
11197
836427db633b
Make colorbar function aware of dataaspect settings
Konstantinos Poulios <logari81@googlemail.com>
parents:
11149
diff
changeset
|
341 if (strcmpi (obj.plotboxaspectratiomode, "manual") |
836427db633b
Make colorbar function aware of dataaspect settings
Konstantinos Poulios <logari81@googlemail.com>
parents:
11149
diff
changeset
|
342 || strcmpi (obj.dataaspectratiomode, "manual")) |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
343 obj.position = pos; |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
344 actual_pos = __actual_axis_position__ (obj); |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
345 if (strfind (cbox, "outside")) |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
346 scale = 1.0; |
8208 | 347 else |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
348 scale = 0.9; |
8208 | 349 endif |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
350 if (sz(1) > sz(2)) |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
351 ## Ensure north or south colorbars are the proper length |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
352 dx = (1-scale)*actual_pos(3); |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
353 cpos(1) = actual_pos(1) + dx/2; |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
354 cpos(3) = actual_pos(3) - dx; |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
355 else |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
356 ## Ensure east or west colorbars are the proper height |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
357 dy = (1-scale)*actual_pos(4); |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
358 cpos(2) = actual_pos(2) + dy/2; |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
359 cpos(4) = actual_pos(4) - dy; |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
360 endif |
8208 | 361 endif |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
362 |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
363 endfunction |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
364 |
7189 | 365 %!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
|
366 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
367 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
7189 | 368 %! imagesc(x) |
369 %! colorbar(); | |
370 | |
371 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
372 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
373 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
7189 | 374 %! imagesc(x) |
375 %! colorbar("westoutside"); | |
376 | |
377 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
378 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
379 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
7189 | 380 %! imagesc(x) |
10534
eb55e736060e
colorbar.m: Allow 'peer' option to be specified.
Ben Abbott <bpabbott@mac.com>
parents:
10532
diff
changeset
|
381 %! colorbar("peer", gca (), "northoutside"); |
7189 | 382 |
383 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
384 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
385 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
7189 | 386 %! imagesc(x) |
387 %! colorbar("southoutside"); | |
388 | |
389 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
390 %! clf |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
391 %! contour(peaks()) |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
392 %! colorbar("west"); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
393 |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
394 %!demo |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
395 %! clf |
7189 | 396 %! subplot(2,2,1) |
397 %! contour(peaks()) | |
398 %! colorbar("east"); | |
399 %! subplot(2,2,2) | |
400 %! contour(peaks()) | |
401 %! colorbar("west"); | |
402 %! subplot(2,2,3) | |
403 %! contour(peaks()) | |
404 %! colorbar("north"); | |
405 %! subplot(2,2,4) | |
406 %! contour(peaks()) | |
407 %! colorbar("south"); | |
408 | |
409 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
410 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
411 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
7189 | 412 %! subplot(2,2,1) |
413 %! imagesc(x) | |
414 %! colorbar(); | |
415 %! subplot(2,2,2) | |
416 %! imagesc(x) | |
417 %! colorbar("westoutside"); | |
418 %! subplot(2,2,3) | |
419 %! imagesc(x) | |
420 %! colorbar("northoutside"); | |
421 %! subplot(2,2,4) | |
422 %! imagesc(x) | |
423 %! colorbar("southoutside"); | |
424 | |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
425 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
426 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
427 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
428 %! 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
|
429 %! 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
|
430 %! 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
|
431 %! colorbar(); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
432 %! 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
|
433 %! 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
|
434 %! 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
|
435 %! 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
|
436 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
437 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
438 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
439 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
440 %! 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
|
441 %! 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
|
442 %! 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
|
443 %! 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
|
444 %! 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
|
445 %! 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
|
446 %! 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
|
447 %! 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
|
448 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
449 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
450 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
451 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
452 %! 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
|
453 %! 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
|
454 %! 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
|
455 %! colorbar(); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
456 %! 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
|
457 %! 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
|
458 %! 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
|
459 %! 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
|
460 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
461 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
462 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
463 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
464 %! 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
|
465 %! 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
|
466 %! 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
|
467 %! 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
|
468 %! 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
|
469 %! 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
|
470 %! 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
|
471 %! 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
|
472 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
473 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
474 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
475 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
476 %! 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
|
477 %! 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
|
478 %! colorbar(); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
479 %! 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
|
480 %! 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
|
481 %! 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
|
482 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
483 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
484 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
485 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
486 %! 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
|
487 %! 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
|
488 %! 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
|
489 %! 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
|
490 %! 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
|
491 %! 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
|
492 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
493 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
494 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
495 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
496 %! 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
|
497 %! 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
|
498 %! colorbar(); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
499 %! 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
|
500 %! 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
|
501 %! 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
|
502 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
503 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
504 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
505 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
506 %! 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
|
507 %! 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
|
508 %! 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
|
509 %! 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
|
510 %! 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
|
511 %! 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
|
512 |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
513 %!demo |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
514 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
515 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
8889
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,1) |
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 %! axis square; |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
519 %! colorbar("east"); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
520 %! 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
|
521 %! 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
|
522 %! 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
|
523 %! contour(x) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
524 %! colorbar("west"); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
525 %! 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
|
526 %! 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
|
527 |
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
|
528 %!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
|
529 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
530 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
8892
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
531 %! 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
|
532 %! 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
|
533 %! 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
|
534 %! 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
|
535 %! 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
|
536 |
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 %!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
|
538 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
539 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
8892
32d218494602
colorbar.m: Bug fix. Allow hidden colorbars to be deleted, and replace existing colorbar when a new one is created. Additional demos are included to verify these behaviors.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
540 %! 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
|
541 %! 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
|
542 %! 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
|
543 %! 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
|
544 %! 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
|
545 |
9281
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 (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 %! set (h, 'yscale', 'log'); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
551 |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
552 %!demo |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
553 %! clf |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
554 %! imagesc (log10 (1 ./ hilb (99))); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
555 %! h = colorbar; |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
556 %! ytick = get(h, "ytick"); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
557 %! set (h, "yticklabel", sprintf ('10^{%g}|', ytick)); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
558 |
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
|
559 %!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
|
560 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
561 %! n=5;x=linspace(0,5,n);y=linspace(0,1,n); |
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
562 %! imagesc(1./hilb(n)); axis equal; 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
|
563 |
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 %!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
|
565 %! clf |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
566 %! n=5;x=linspace(0,5,n);y=linspace(0,1,n); |
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
567 %! imagesc(x,y,1./hilb(n)); axis equal; 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
|
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 |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
571 %! n=5;x=linspace(0,5,n);y=linspace(0,1,n); |
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
|
572 %! 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
|
573 ## 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
|
574 |
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 %!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
|
576 %! 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
|
577 %! 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
|
578 %! 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
|
579 %! 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
|
580 %! 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
|
581 %! 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
|
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 ("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
|
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 ("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
|
593 %! 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
|
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 |
10910
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
597 %! pcolor (peaks (20)) |
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
598 %! shading ("interp") |
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
599 %! axis ("tight", "square") |
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
600 %! colorbar () |
11001
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
601 #%! axes('color','none','box','on','activepositionproperty','position') |
10910
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
602 |
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
603 %!demo |
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
604 %! clf |
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
|
605 %! 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
|
606 %! 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
|
607 %! 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
|
608 |
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
|
609 %!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
|
610 %! 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
|
611 %! 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
|
612 %! 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
|
613 %! axis equal |