Mercurial > hg > octave-lyh
annotate scripts/plot/colorbar.m @ 11540:b0ef6f28e09a
deprecate krylovb function
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 15 Jan 2011 03:40:32 -0500 |
parents | fd0a3ac60b0e |
children | 8ac9687dbe9f |
rev | line source |
---|---|
11523 | 1 ## Copyright (C) 2008-2011 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{}) |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
22 ## Adds a colorbar to the current axes. Valid values for @var{s} are |
7189 | 23 ## |
24 ## @table @asis | |
8507 | 25 ## @item "EastOutside" |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
26 ## Place the colorbar outside the plot to the right. This is the default. |
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++}; | |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
66 |
8208 | 67 if (ischar(arg)) |
68 if (strcmpi (arg, "peer")) | |
10549 | 69 if (i > nargin) |
70 error ("colorbar: missing axes handle after \"peer\""); | |
71 else | |
72 ax = varargin{i++}; | |
73 if (!isscalar (ax) || ! ishandle (ax) | |
74 || ! strcmp (get (ax, "type"), "axes")) | |
75 error ("colorbar: expecting an axes handle following \"peer\""); | |
76 endif | |
77 endif | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8102
diff
changeset
|
78 elseif (strcmpi (arg, "north") || strcmpi (arg, "south") |
10549 | 79 || strcmpi (arg, "east") || strcmpi (arg, "west") |
80 || strcmpi (arg, "northoutside") || strcmpi (arg, "southoutside") | |
81 || strcmpi (arg, "eastoutside") || strcmpi (arg, "westoutside")) | |
82 loc = tolower (arg); | |
8208 | 83 elseif (strcmpi (arg, "off") || strcmpi (arg, "none")) |
10549 | 84 deleting = true; |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
85 else |
10549 | 86 args{end+1} = arg; |
8208 | 87 endif |
88 else | |
89 args{end+1} = arg; | |
90 endif | |
91 endwhile | |
92 | |
93 if (isempty (ax)) | |
94 ax = gca (); | |
95 endif | |
96 | |
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
|
97 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
|
98 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 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
|
100 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
|
101 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
|
102 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
|
103 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
|
104 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
|
105 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
|
106 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
|
107 |
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 if (! deleting) |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
109 ## FIXME - Matlab does not require the "position" property to be active. |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
110 ## Is there a way to determine the plotbox position for the gnuplot |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
111 ## backend with the outerposition is active? |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
112 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
|
113 obj = get (ax); |
10920
91ff0d7ee94b
Don't pass figure handle to __calc_dimensions__.
Ben Abbott <bpabbott@mac.com>
parents:
10910
diff
changeset
|
114 obj.__my_handle__ = ax; |
8208 | 115 position = obj.position; |
116 clen = rows (get (get (ax, "parent"), "colormap")); | |
117 cext = get (ax, "clim"); | |
118 cdiff = (cext(2) - cext(1)) / clen / 2; | |
119 cmin = cext(1) + cdiff; | |
120 cmax = cext(2) - cdiff; | |
121 | |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
122 [pos, cpos, vertical, mirror] = ... |
10549 | 123 __position_colorbox__ (loc, obj, ancestor (ax, "figure")); |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
124 set (ax, "position", pos); |
8208 | 125 |
126 cax = __go_axes__ (get (ax, "parent"), "tag", "colorbar", | |
10549 | 127 "handlevisibility", "on", |
128 "activepositionproperty", "position", | |
129 "position", cpos); | |
8208 | 130 addproperty ("location", cax, "radio", |
10549 | 131 "eastoutside|east|westoutside|west|northoutside|north|southoutside|south", |
132 loc); | |
8208 | 133 addproperty ("axes", cax, "handle", ax); |
134 | |
135 if (vertical) | |
136 hi = image (cax, [0,1], [cmin, cmax], [1 : clen]'); | |
137 if (mirror) | |
10549 | 138 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
139 "ylim", cext, "ylimmode", "manual", | |
140 "yaxislocation", "right", args{:}); | |
8208 | 141 else |
10549 | 142 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
143 "ylim", cext, "ylimmode", "manual", | |
144 "yaxislocation", "left", args{:}); | |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
145 endif |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
146 else |
8208 | 147 hi = image (cax, [cmin, cmax], [0,1], [1 : clen]); |
148 if (mirror) | |
10549 | 149 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
150 "xlim", cext, "xlimmode", "manual", | |
151 "xaxislocation", "top", args{:}); | |
8208 | 152 else |
10549 | 153 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
154 "xlim", cext, "xlimmode", "manual", | |
155 "xaxislocation", "bottom", args{:}); | |
8208 | 156 endif |
157 endif | |
158 | |
159 ctext = text (0, 0, "", "tag", "colorbar","visible", "off", | |
10549 | 160 "handlevisibility", "off", "xliminclude", "off", |
161 "yliminclude", "off", "zliminclude", "off", | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
162 "deletefcn", {@deletecolorbar, cax, obj}); |
8208 | 163 |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
164 set (cax, "deletefcn", {@resetaxis, obj}); |
8208 | 165 |
166 addlistener (ax, "clim", {@update_colorbar_clim, hi, vertical}) | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
167 addlistener (ax, "plotboxaspectratio", {@update_colorbar_axis, cax, obj}) |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
168 addlistener (ax, "plotboxaspectratiomode", {@update_colorbar_axis, cax, obj}) |
11197
836427db633b
Make colorbar function aware of dataaspect settings
Konstantinos Poulios <logari81@googlemail.com>
parents:
11149
diff
changeset
|
169 addlistener (ax, "dataaspectratio", {@update_colorbar_axis, cax, obj}) |
836427db633b
Make colorbar function aware of dataaspect settings
Konstantinos Poulios <logari81@googlemail.com>
parents:
11149
diff
changeset
|
170 addlistener (ax, "dataaspectratiomode", {@update_colorbar_axis, cax, obj}) |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
171 addlistener (ax, "position", {@update_colorbar_axis, cax, obj}) |
8208 | 172 |
173 endif | |
174 | |
175 if (nargout > 0) | |
176 h = cax; | |
177 endif | |
178 endfunction | |
179 | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
180 function deletecolorbar (h, d, hc, orig_props) |
8208 | 181 ## Don't delete the colorbar and reset the axis size if the |
182 ## 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
|
183 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
|
184 && (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off"))) |
8208 | 185 if (strcmp (get (hc, "beingdeleted"), "off")) |
186 delete (hc); | |
187 endif | |
11149
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
188 if (!isempty (ancestor (h, "axes")) |
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
189 && strcmp (get (ancestor (h, "axes"), "beingdeleted"), "off")) |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
190 set (ancestor (h, "axes"), "position", orig_props.position, ... |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
191 "outerposition", orig_props.outerposition, ... |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
192 "activepositionproperty", orig_props.activepositionproperty); |
8208 | 193 endif |
194 endif | |
195 endfunction | |
196 | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
197 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
|
198 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
|
199 && (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
|
200 && ishandle (get (h, "axes"))) |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
201 set (get (h, "axes"), "position", orig_props.position, ... |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
202 "outerposition", orig_props.outerposition, ... |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
203 "activepositionproperty", orig_props.activepositionproperty); |
8208 | 204 endif |
205 endfunction | |
206 | |
207 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
|
208 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
|
209 && (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off"))) |
8208 | 210 clen = rows (get (get (h, "parent"), "colormap")); |
211 cext = get (h, "clim"); | |
212 cdiff = (cext(2) - cext(1)) / clen / 2; | |
213 cmin = cext(1) + cdiff; | |
214 cmax = cext(2) - cdiff; | |
215 | |
216 if (vert) | |
217 set (hi, "ydata", [cmin, cmax]); | |
218 set (get (hi, "parent"), "ylim", cext); | |
219 else | |
220 set (hi, "xdata", [cmin, cmax]); | |
221 set (get (hi, "parent"), "xlim", cext); | |
222 endif | |
223 endif | |
224 endfunction | |
225 | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
226 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
|
227 |
11149
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
228 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
|
229 && (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off"))) |
8208 | 230 loc = get (cax, "location"); |
231 obj = get (h); | |
10920
91ff0d7ee94b
Don't pass figure handle to __calc_dimensions__.
Ben Abbott <bpabbott@mac.com>
parents:
10910
diff
changeset
|
232 obj.__my_handle__ = h; |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
233 obj.position = orig_props.position; |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
234 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
|
235 [pos, cpos, vertical, mirror] = ... |
10549 | 236 __position_colorbox__ (loc, obj, ancestor (h, "figure")); |
8208 | 237 |
238 if (vertical) | |
239 if (mirror) | |
10549 | 240 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
241 "yaxislocation", "right", "position", cpos); | |
8208 | 242 else |
10549 | 243 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
244 "yaxislocation", "left", "position", cpos); | |
8208 | 245 endif |
246 else | |
247 if (mirror) | |
10549 | 248 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
249 "xaxislocation", "top", "position", cpos); | |
8208 | 250 else |
10549 | 251 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
252 "xaxislocation", "bottom", "position", cpos); | |
8208 | 253 endif |
254 endif | |
255 | |
256 endif | |
257 endfunction | |
258 | |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
259 function [pos, cpos, vertical, mirr] = __position_colorbox__ (cbox, obj, cf) |
8208 | 260 |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
261 ## This will always represent the position prior to adding the colorbar. |
8208 | 262 pos = obj.position; |
263 sz = pos(3:4); | |
264 | |
11197
836427db633b
Make colorbar function aware of dataaspect settings
Konstantinos Poulios <logari81@googlemail.com>
parents:
11149
diff
changeset
|
265 if (strcmpi (obj.plotboxaspectratiomode, "manual") |
836427db633b
Make colorbar function aware of dataaspect settings
Konstantinos Poulios <logari81@googlemail.com>
parents:
11149
diff
changeset
|
266 || strcmpi (obj.dataaspectratiomode, "manual")) |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
267 if (isempty (strfind (cbox, "outside"))) |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
268 scale = 1.0; |
8208 | 269 else |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
270 scale = 0.8; |
8208 | 271 endif |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
272 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
|
273 scale = [1, scale]; |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
274 else |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
275 scale = [scale, 1]; |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
276 endif |
11001
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
277 if (strcmp (get (cf, "__backend__"), "gnuplot") |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
278 && strcmp (obj.activepositionproperty, "outerposition")) |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
279 obj.outerposition = obj.outerposition .* [1, 1, scale]; |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
280 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
|
281 else |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
282 obj.position = obj.position .* [1, 1, scale]; |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
283 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
|
284 endif |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
285 else |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
286 off = 0.0; |
8208 | 287 endif |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
288 |
8208 | 289 switch (cbox) |
290 case "northoutside" | |
291 origin = pos(1:2) + [0., 0.9] .* sz + [1, -1] .* off; | |
292 sz = sz .* [1.0, 0.06]; | |
293 pos(4) = 0.8 * pos(4); | |
294 mirr = true; | |
295 vertical = false; | |
296 case "north" | |
297 origin = pos(1:2) + [0.05, 0.9] .* sz + [1, -1] .* off; | |
298 sz = sz .* [1.0, 0.06] * 0.9; | |
299 mirr = false; | |
300 vertical = false; | |
301 case "southoutside" | |
302 origin = pos(1:2) + off; | |
303 sz = sz .* [1.0, 0.06]; | |
304 pos(2) = pos(2) + pos(4) * 0.2; | |
305 pos(4) = 0.8 * pos(4); | |
306 mirr = false; | |
307 vertical = false; | |
308 case "south" | |
309 origin = pos(1:2) + [0.05, 0.05] .* sz + off; | |
310 sz = sz .* [1.0, 0.06] * 0.9; | |
311 mirr = true; | |
312 vertical = false; | |
313 case "eastoutside" | |
314 origin = pos(1:2) + [0.9, 0] .* sz + [-1, 1] .* off; | |
315 sz = sz .* [0.06, 1.0]; | |
316 pos(3) = 0.8 * pos(3); | |
317 mirr = true; | |
318 vertical = true; | |
319 case "east" | |
320 origin = pos(1:2) + [0.9, 0.05] .* sz + [-1, 1] .* off; | |
321 sz = sz .* [0.06, 1.0] * 0.9; | |
322 mirr = false; | |
323 vertical = true; | |
324 case "westoutside" | |
325 origin = pos(1:2) + off; | |
326 sz = sz .* [0.06, 1.0]; | |
327 pos(1) = pos(1) + pos(3) * 0.2; | |
328 pos(3) = 0.8 * pos(3); | |
329 mirr = false; | |
330 vertical = true; | |
331 case "west" | |
332 origin = pos(1:2) + [0.05, 0.05] .* sz + off; | |
333 sz = sz .* [0.06, 1.0] .* 0.9; | |
334 mirr = true; | |
335 vertical = true; | |
336 endswitch | |
337 | |
338 cpos = [origin, sz]; | |
339 | |
11197
836427db633b
Make colorbar function aware of dataaspect settings
Konstantinos Poulios <logari81@googlemail.com>
parents:
11149
diff
changeset
|
340 if (strcmpi (obj.plotboxaspectratiomode, "manual") |
836427db633b
Make colorbar function aware of dataaspect settings
Konstantinos Poulios <logari81@googlemail.com>
parents:
11149
diff
changeset
|
341 || 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
|
342 obj.position = pos; |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
343 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
|
344 if (strfind (cbox, "outside")) |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
345 scale = 1.0; |
8208 | 346 else |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
347 scale = 0.9; |
8208 | 348 endif |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
349 if (sz(1) > sz(2)) |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
350 ## 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
|
351 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
|
352 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
|
353 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
|
354 else |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
355 ## 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
|
356 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
|
357 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
|
358 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
|
359 endif |
8208 | 360 endif |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
361 |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
362 endfunction |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
363 |
7189 | 364 %!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
|
365 %! clf |
7189 | 366 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
367 %! imagesc(x) | |
368 %! colorbar(); | |
369 | |
370 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
371 %! clf |
7189 | 372 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
373 %! imagesc(x) | |
374 %! colorbar("westoutside"); | |
375 | |
376 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
377 %! clf |
7189 | 378 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
379 %! imagesc(x) | |
10534
eb55e736060e
colorbar.m: Allow 'peer' option to be specified.
Ben Abbott <bpabbott@mac.com>
parents:
10532
diff
changeset
|
380 %! colorbar("peer", gca (), "northoutside"); |
7189 | 381 |
382 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
383 %! clf |
7189 | 384 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
385 %! imagesc(x) | |
386 %! colorbar("southoutside"); | |
387 | |
388 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
389 %! clf |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
390 %! contour(peaks()) |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
391 %! colorbar("west"); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
392 |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
393 %!demo |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
394 %! clf |
7189 | 395 %! subplot(2,2,1) |
396 %! contour(peaks()) | |
397 %! colorbar("east"); | |
398 %! subplot(2,2,2) | |
399 %! contour(peaks()) | |
400 %! colorbar("west"); | |
401 %! subplot(2,2,3) | |
402 %! contour(peaks()) | |
403 %! colorbar("north"); | |
404 %! subplot(2,2,4) | |
405 %! contour(peaks()) | |
406 %! colorbar("south"); | |
407 | |
408 %!demo | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
409 %! clf |
7189 | 410 %! n = 64; x = kron (1:n,ones(n,1)); x = abs(x - x.'); |
411 %! subplot(2,2,1) | |
412 %! imagesc(x) | |
413 %! colorbar(); | |
414 %! subplot(2,2,2) | |
415 %! imagesc(x) | |
416 %! colorbar("westoutside"); | |
417 %! subplot(2,2,3) | |
418 %! imagesc(x) | |
419 %! colorbar("northoutside"); | |
420 %! subplot(2,2,4) | |
421 %! imagesc(x) | |
422 %! colorbar("southoutside"); | |
423 | |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
424 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
425 %! 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
|
426 %! 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
|
427 %! 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
|
428 %! 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
|
429 %! 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
|
430 %! colorbar(); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
431 %! 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
|
432 %! 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
|
433 %! 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
|
434 %! 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
|
435 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
436 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
437 %! 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
|
438 %! 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
|
439 %! 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
|
440 %! 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
|
441 %! 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
|
442 %! 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
|
443 %! 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
|
444 %! 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
|
445 %! 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
|
446 %! 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
|
447 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
448 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
449 %! 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
|
450 %! 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
|
451 %! 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
|
452 %! 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
|
453 %! 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
|
454 %! colorbar(); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
455 %! 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
|
456 %! 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
|
457 %! 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
|
458 %! 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
|
459 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
460 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
461 %! 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
|
462 %! 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
|
463 %! 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
|
464 %! 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
|
465 %! 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
|
466 %! 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
|
467 %! 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
|
468 %! 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
|
469 %! 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
|
470 %! 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
|
471 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
472 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
473 %! 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
|
474 %! 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
|
475 %! 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
|
476 %! 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
|
477 %! colorbar(); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
478 %! 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
|
479 %! 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
|
480 %! 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
|
481 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
482 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
483 %! 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
|
484 %! 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
|
485 %! 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
|
486 %! 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
|
487 %! 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
|
488 %! 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
|
489 %! 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
|
490 %! 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
|
491 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
492 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
493 %! 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
|
494 %! 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
|
495 %! 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
|
496 %! 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
|
497 %! colorbar(); |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
498 %! 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
|
499 %! 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
|
500 %! 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
|
501 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
502 %!demo |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
503 %! 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
|
504 %! 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
|
505 %! 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
|
506 %! 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
|
507 %! 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
|
508 %! 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
|
509 %! 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
|
510 %! 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
|
511 |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
512 %!demo |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
513 %! clf |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
514 %! 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
|
515 %! 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
|
516 %! contour(x) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
517 %! axis square; |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
518 %! colorbar("east"); |
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 %! 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
|
522 %! contour(x) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
523 %! colorbar("west"); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8790
diff
changeset
|
524 %! 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
|
525 %! 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
|
526 |
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
|
527 %!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
|
528 %! 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
|
529 %! 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
|
530 %! 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
|
531 %! 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
|
532 %! 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
|
533 %! 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
|
534 %! 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
|
535 |
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 %!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
|
537 %! 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
|
538 %! 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
|
539 %! 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
|
540 %! 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
|
541 %! 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
|
542 %! 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
|
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 |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
545 %!demo |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
546 %! clf |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
547 %! imagesc (1./hilb(99)); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
548 %! h = colorbar; |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
549 %! set (h, 'yscale', 'log'); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
550 |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
551 %!demo |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
552 %! clf |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
553 %! imagesc (log10 (1 ./ hilb (99))); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
554 %! h = colorbar; |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
555 %! ytick = get(h, "ytick"); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
556 %! set (h, "yticklabel", sprintf ('10^{%g}|', ytick)); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
557 |
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
|
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(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(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
|
567 |
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 %!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
|
569 %! 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
|
570 %! 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
|
571 %! 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
|
572 ## 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
|
573 |
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 %!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
|
575 %! 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
|
576 %! 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
|
577 %! 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
|
578 %! 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
|
579 %! 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
|
580 %! 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
|
581 |
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 %!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
|
583 %! 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
|
584 %! 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
|
585 %! 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
|
586 %! 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
|
587 |
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 %!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
|
589 %! 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
|
590 %! 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
|
591 %! 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
|
592 %! 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
|
593 |
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 %!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
|
595 %! clf |
10910
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
596 %! pcolor (peaks (20)) |
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
597 %! shading ("interp") |
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
598 %! axis ("tight", "square") |
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
599 %! colorbar () |
11001
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
600 #%! 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
|
601 |
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
602 %!demo |
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
603 %! 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
|
604 %! 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
|
605 %! 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
|
606 %! 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
|
607 |
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 %!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
|
609 %! 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
|
610 %! 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
|
611 %! 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
|
612 %! axis equal |