Mercurial > octave-nkf
annotate scripts/plot/colorbar.m @ 17281:bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Macro handles options ("on") or properties ("position") more elegantly
than @code{"text"}.
* doc/interpreter/macros.texi: Add new @qcode macro.
* doc/interpreter/tips.txi: Add documentation about @qcode macro.
* doc/interpreter/basics.txi, doc/interpreter/container.txi,
doc/interpreter/emacs.txi, doc/interpreter/errors.txi,
doc/interpreter/eval.txi, doc/interpreter/expr.txi,
doc/interpreter/external.txi, doc/interpreter/func.txi,
doc/interpreter/grammar.txi, doc/interpreter/image.txi,
doc/interpreter/install.txi, doc/interpreter/interp.txi,
doc/interpreter/io.txi, doc/interpreter/matrix.txi,
doc/interpreter/numbers.txi, doc/interpreter/oop.txi,
doc/interpreter/package.txi, doc/interpreter/plot.txi,
doc/interpreter/quad.txi, doc/interpreter/sparse.txi,
doc/interpreter/strings.txi, doc/interpreter/system.txi,
doc/interpreter/vectorize.txi, libinterp/corefcn/balance.cc,
libinterp/corefcn/bitfcns.cc, libinterp/corefcn/cellfun.cc,
libinterp/corefcn/conv2.cc, libinterp/corefcn/data.cc,
libinterp/corefcn/debug.cc, libinterp/corefcn/defaults.cc,
libinterp/corefcn/dirfns.cc, libinterp/corefcn/dlmread.cc,
libinterp/corefcn/error.cc, libinterp/corefcn/file-io.cc,
libinterp/corefcn/find.cc, libinterp/corefcn/gammainc.cc,
libinterp/corefcn/graphics.cc, libinterp/corefcn/help.cc,
libinterp/corefcn/hex2num.cc, libinterp/corefcn/input.cc,
libinterp/corefcn/load-path.cc, libinterp/corefcn/load-save.cc,
libinterp/corefcn/ls-oct-ascii.cc, libinterp/corefcn/lu.cc,
libinterp/corefcn/luinc.cc, libinterp/corefcn/matrix_type.cc,
libinterp/corefcn/oct-hist.cc, libinterp/corefcn/pager.cc,
libinterp/corefcn/pr-output.cc, libinterp/corefcn/pt-jit.cc,
libinterp/corefcn/qz.cc, libinterp/corefcn/rand.cc,
libinterp/corefcn/regexp.cc, libinterp/corefcn/schur.cc,
libinterp/corefcn/sighandlers.cc, libinterp/corefcn/sparse.cc,
libinterp/corefcn/spparms.cc, libinterp/corefcn/str2double.cc,
libinterp/corefcn/svd.cc, libinterp/corefcn/symtab.cc,
libinterp/corefcn/syscalls.cc, libinterp/corefcn/toplev.cc,
libinterp/corefcn/tril.cc, libinterp/corefcn/typecast.cc,
libinterp/corefcn/utils.cc, libinterp/corefcn/variables.cc,
libinterp/dldfcn/__init_fltk__.cc, libinterp/dldfcn/chol.cc,
libinterp/dldfcn/colamd.cc, libinterp/dldfcn/fftw.cc, libinterp/dldfcn/qr.cc,
libinterp/dldfcn/symbfact.cc, libinterp/octave-value/ov-base.cc,
libinterp/octave-value/ov-fcn-handle.cc,
libinterp/octave-value/ov-fcn-inline.cc, libinterp/octave-value/ov-java.cc,
libinterp/octave-value/ov-range.cc, libinterp/octave-value/ov-struct.cc,
libinterp/octave-value/ov-usr-fcn.cc, libinterp/parse-tree/oct-parse.in.yy,
libinterp/parse-tree/pt-binop.cc, libinterp/parse-tree/pt-eval.cc,
libinterp/parse-tree/pt-mat.cc, scripts/@ftp/ftp.m,
scripts/deprecated/java_convert_matrix.m, scripts/deprecated/java_debug.m,
scripts/deprecated/java_unsigned_conversion.m, scripts/deprecated/shell_cmd.m,
scripts/general/dblquad.m, scripts/general/display.m,
scripts/general/genvarname.m, scripts/general/idivide.m,
scripts/general/interp1.m, scripts/general/interp2.m,
scripts/general/interp3.m, scripts/general/interpn.m, scripts/general/isa.m,
scripts/general/profexplore.m, scripts/general/profile.m,
scripts/general/quadgk.m, scripts/general/randi.m, scripts/general/structfun.m,
scripts/general/subsindex.m, scripts/general/triplequad.m,
scripts/geometry/griddata.m, scripts/geometry/griddata3.m,
scripts/geometry/griddatan.m, scripts/geometry/voronoi.m, scripts/help/help.m,
scripts/help/lookfor.m, scripts/image/cmpermute.m, scripts/image/colormap.m,
scripts/image/image.m, scripts/image/imagesc.m, scripts/image/imfinfo.m,
scripts/image/imformats.m, scripts/image/imread.m, scripts/image/imshow.m,
scripts/image/imwrite.m, scripts/image/ind2gray.m, scripts/image/lines.m,
scripts/image/rgb2ind.m, scripts/image/spinmap.m, scripts/io/dlmwrite.m,
scripts/io/strread.m, scripts/io/textread.m, scripts/io/textscan.m,
scripts/java/javaclasspath.m, scripts/java/usejava.m,
scripts/miscellaneous/bzip2.m, scripts/miscellaneous/computer.m,
scripts/miscellaneous/copyfile.m, scripts/miscellaneous/debug.m,
scripts/miscellaneous/dos.m, scripts/miscellaneous/edit.m,
scripts/miscellaneous/gzip.m, scripts/miscellaneous/license.m,
scripts/miscellaneous/mkoctfile.m, scripts/miscellaneous/movefile.m,
scripts/miscellaneous/parseparams.m, scripts/miscellaneous/unix.m,
scripts/optimization/fminbnd.m, scripts/optimization/fminsearch.m,
scripts/optimization/fminunc.m, scripts/optimization/fsolve.m,
scripts/optimization/fzero.m, scripts/optimization/glpk.m,
scripts/optimization/lsqnonneg.m, scripts/optimization/optimset.m,
scripts/optimization/pqpnonneg.m, scripts/pkg/pkg.m, scripts/plot/allchild.m,
scripts/plot/ancestor.m, scripts/plot/area.m, scripts/plot/axis.m,
scripts/plot/bar.m, scripts/plot/barh.m, scripts/plot/box.m,
scripts/plot/caxis.m, scripts/plot/cla.m, scripts/plot/clabel.m,
scripts/plot/clf.m, scripts/plot/close.m, scripts/plot/colorbar.m,
scripts/plot/daspect.m, scripts/plot/ezmesh.m, scripts/plot/ezmeshc.m,
scripts/plot/ezsurf.m, scripts/plot/ezsurfc.m, scripts/plot/findall.m,
scripts/plot/findobj.m, scripts/plot/gcbo.m, scripts/plot/gcf.m,
scripts/plot/gco.m, scripts/plot/grid.m, scripts/plot/guihandles.m,
scripts/plot/hdl2struct.m, scripts/plot/hidden.m, scripts/plot/hold.m,
scripts/plot/isonormals.m, scripts/plot/isosurface.m, scripts/plot/legend.m,
scripts/plot/mesh.m, scripts/plot/meshc.m, scripts/plot/meshz.m,
scripts/plot/newplot.m, scripts/plot/orient.m, scripts/plot/pareto.m,
scripts/plot/patch.m, scripts/plot/pbaspect.m, scripts/plot/pcolor.m,
scripts/plot/plot.m, scripts/plot/print.m,
scripts/plot/private/__add_default_menu__.m, scripts/plot/quiver.m,
scripts/plot/quiver3.m, scripts/plot/refreshdata.m, scripts/plot/saveas.m,
scripts/plot/scatter.m, scripts/plot/scatter3.m, scripts/plot/shading.m,
scripts/plot/shrinkfaces.m, scripts/plot/slice.m, scripts/plot/stem.m,
scripts/plot/stem3.m, scripts/plot/struct2hdl.m, scripts/plot/subplot.m,
scripts/plot/surf.m, scripts/plot/surfc.m, scripts/plot/surfl.m,
scripts/plot/tetramesh.m, scripts/plot/uigetfile.m, scripts/plot/uimenu.m,
scripts/plot/uiputfile.m, scripts/plot/waterfall.m, scripts/plot/whitebg.m,
scripts/plot/xlim.m, scripts/plot/ylim.m, scripts/plot/zlim.m,
scripts/polynomial/conv.m, scripts/polynomial/polyout.m,
scripts/polynomial/splinefit.m, scripts/set/ismember.m, scripts/set/powerset.m,
scripts/set/setdiff.m, scripts/set/union.m, scripts/set/unique.m,
scripts/signal/detrend.m, scripts/signal/filter2.m, scripts/signal/freqz.m,
scripts/signal/periodogram.m, scripts/signal/spectral_adf.m,
scripts/signal/spectral_xdf.m, scripts/sparse/eigs.m, scripts/sparse/svds.m,
scripts/specfun/legendre.m, scripts/special-matrix/gallery.m,
scripts/statistics/base/mean.m, scripts/statistics/base/moment.m,
scripts/statistics/tests/cor_test.m,
scripts/statistics/tests/kolmogorov_smirnov_test.m,
scripts/statistics/tests/kolmogorov_smirnov_test_2.m,
scripts/statistics/tests/kruskal_wallis_test.m,
scripts/statistics/tests/prop_test_2.m, scripts/statistics/tests/sign_test.m,
scripts/statistics/tests/t_test.m, scripts/statistics/tests/t_test_2.m,
scripts/statistics/tests/t_test_regression.m,
scripts/statistics/tests/u_test.m, scripts/statistics/tests/var_test.m,
scripts/statistics/tests/welch_test.m,
scripts/statistics/tests/wilcoxon_test.m, scripts/statistics/tests/z_test.m,
scripts/statistics/tests/z_test_2.m, scripts/strings/base2dec.m,
scripts/strings/index.m, scripts/strings/isstrprop.m,
scripts/strings/mat2str.m, scripts/strings/regexptranslate.m,
scripts/strings/rindex.m, scripts/strings/str2num.m, scripts/strings/strcat.m,
scripts/strings/strjust.m, scripts/strings/strmatch.m,
scripts/strings/validatestring.m, scripts/testfun/demo.m,
scripts/testfun/example.m, scripts/testfun/test.m, scripts/time/addtodate.m,
scripts/time/asctime.m, scripts/time/datestr.m, scripts/time/datetick.m,
scripts/time/weekday.m, scripts/ui/errordlg.m, scripts/ui/helpdlg.m,
scripts/ui/inputdlg.m, scripts/ui/listdlg.m, scripts/ui/msgbox.m,
scripts/ui/questdlg.m, scripts/ui/warndlg.m: Use new @qcode macro.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 19 Aug 2013 20:46:38 -0700 |
parents | df4c4b7708a4 |
children | 95bfa04ab514 |
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 -*- | |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17096
diff
changeset
|
20 ## @deftypefn {Command} {} colorbar |
17096 | 21 ## @deftypefnx {Function File} {} colorbar (@var{loc}) |
22 ## @deftypefnx {Function File} {} colorbar (@var{delete_option}) | |
23 ## @deftypefnx {Function File} {} colorbar (@var{hcb}, @dots{}) | |
24 ## @deftypefnx {Function File} {} colorbar (@var{hax}, @dots{}) | |
25 ## @deftypefnx {Function File} {} colorbar (@dots{}, "peer", @var{hax}, @dots{}) | |
26 ## @deftypefnx {Function File} {} colorbar (@dots{}, "location", @var{loc}, @dots{}) | |
27 ## @deftypefnx {Function File} {} colorbar (@dots{}, @var{prop}, @var{val}, @dots{}) | |
28 ## @deftypefnx {Function File} {@var{h} =} colorbar (@dots{}) | |
29 ## Add a colorbar to the current axes. | |
30 ## | |
31 ## A colorbar displays the current colormap along with numerical rulings | |
32 ## so that the color scale can be interpreted. | |
33 ## | |
34 ## The optional input @var{loc} determines the location of the colorbar. | |
35 ## Valid values for @var{loc} are | |
7189 | 36 ## |
37 ## @table @asis | |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
38 ## @item @qcode{"EastOutside"} |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
39 ## 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
|
40 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
41 ## @item @qcode{"East"} |
7189 | 42 ## 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
|
43 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
44 ## @item @qcode{"WestOutside"} |
7189 | 45 ## 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
|
46 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
47 ## @item @qcode{"West"} |
7189 | 48 ## 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
|
49 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
50 ## @item @qcode{"NorthOutside"} |
7189 | 51 ## Place the colorbar above the plot. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
52 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
53 ## @item @qcode{"North"} |
7189 | 54 ## 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
|
55 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
56 ## @item @qcode{"SouthOutside"} |
7189 | 57 ## Place the colorbar under the plot. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
58 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
59 ## @item @qcode{"South"} |
7189 | 60 ## Place the colorbar at the bottom of the plot. |
61 ## @end table | |
62 ## | |
17096 | 63 ## To remove a colorbar from a plot use any one of the following keywords for |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
64 ## the @var{delete_option}: @qcode{"delete"}, @qcode{"hide"}, @qcode{"off"}. |
17096 | 65 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
66 ## If the argument @qcode{"peer"} is given, then the following argument is |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
67 ## treated as the axes handle in which to add the colorbar. Alternatively, |
17096 | 68 ## If the first argument @var{hax} is an axes handle, then the colorbar is |
69 ## added to this axis, rather than the current axes returned by @code{gca}. | |
70 ## | |
71 ## If the first argument @var{hcb} is a handle to a colorbar object, then | |
72 ## operate on this colorbar directly. | |
73 ## | |
74 ## Additional property/value pairs are passed directly to the underlying axes | |
75 ## object. | |
76 ## | |
77 ## The optional return value @var{h} is a graphics handle to the created | |
78 ## colorbar object. | |
79 ## | |
80 ## Implementation Note: A colorbar is created as an additional axes to the | |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
81 ## current figure with the @qcode{"tag"} property set to @qcode{"colorbar"}. |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
82 ## The created axes object has the extra property @qcode{"location"} which |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
83 ## controls the positioning of the colorbar. |
17096 | 84 ## @seealso{colormap} |
7189 | 85 ## @end deftypefn |
86 | |
8208 | 87 function h = colorbar (varargin) |
17096 | 88 |
89 [hcb, varargin, nargin] = __plt_get_axis_arg__ ("colorbar", varargin{:}); | |
90 | |
91 if (hcb && ! strcmp (get (hcb, "tag"), "colorbar")) | |
92 ax = hcb; | |
93 hcb = []; | |
94 else | |
95 ax = []; | |
96 endif | |
97 loc = ""; | |
8208 | 98 args = {}; |
99 deleting = false; | |
100 | |
101 i = 1; | |
102 while (i <= nargin) | |
17096 | 103 arg = varargin{i++}; |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14846
diff
changeset
|
104 if (ischar (arg)) |
17096 | 105 switch (tolower (arg)) |
106 case "peer" | |
107 if (i > nargin) | |
108 error ('colorbar: missing axes handle after "peer"'); | |
109 else | |
110 ax = varargin{i++}; | |
17125
b5d6314314fc
Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
111 if (! isscalar (ax) && ! isaxes (ax)) |
17096 | 112 error ('colorbar: expecting an axes handle following "peer"'); |
113 endif | |
10549 | 114 endif |
17096 | 115 case {"north", "south", "east", "west", |
116 "northoutside", "southoutside", "eastoutside", "westoutside"} | |
117 loc = tolower (arg); | |
118 case "location" | |
119 if (i > nargin) | |
120 error ('colorbar: missing value after "location"'); | |
121 else | |
122 loc = tolower (varargin{i++}); | |
123 endif | |
124 case {"delete", "hide", "off", "none"} | |
125 deleting = true; | |
126 otherwise | |
127 args{end+1} = arg; | |
128 endswitch | |
8208 | 129 else |
130 args{end+1} = arg; | |
131 endif | |
132 endwhile | |
133 | |
17096 | 134 ## Handle changes to existing colorbar |
135 if (! isempty (hcb)) | |
136 if (deleting) | |
137 delete (hcb); | |
138 if (nargout > 0) | |
139 h = hcb; | |
140 endif | |
141 return; | |
142 else | |
143 ## FIXME: No listener on location property so have to re-create | |
144 ## colorbar whenever an option changes. | |
145 ## re-instate this code if listener is developed. | |
146 # if (! isempty (loc)) | |
147 # set (hcb, "location", loc); | |
148 # endif | |
149 # if (! isempty (args)) | |
150 # set (hcb, args{:}); | |
151 # endif | |
152 ax = get (get (hcb, "parent"), "currrentaxes"); | |
153 endif | |
154 endif | |
155 | |
156 if (isempty (loc)) | |
157 loc = "eastoutside"; | |
158 endif | |
8208 | 159 if (isempty (ax)) |
160 ax = gca (); | |
161 endif | |
162 | |
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
|
163 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
|
164 unwind_protect |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
165 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
|
166 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
|
167 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
|
168 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
|
169 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
|
170 unwind_protect_cleanup |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
171 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
|
172 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
|
173 |
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
|
174 if (! deleting) |
17096 | 175 ## FIXME: Matlab does not require the "position" property to be active. |
176 ## Is there a way to determine the plotbox position for the | |
177 ## gnuplot graphics toolkit with the outerposition is active? | |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
178 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
|
179 obj = get (ax); |
17096 | 180 obj.__cbar_hax__ = ax; |
8208 | 181 position = obj.position; |
17096 | 182 ## FIXME: Should this be ancestor to accommodate hggroups? |
183 hpar = get (ax, "parent"); | |
184 clen = rows (get (hpar, "colormap")); | |
8208 | 185 cext = get (ax, "clim"); |
186 cdiff = (cext(2) - cext(1)) / clen / 2; | |
187 cmin = cext(1) + cdiff; | |
188 cmax = cext(2) - cdiff; | |
189 | |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
190 [pos, cpos, vertical, mirror] = ... |
10549 | 191 __position_colorbox__ (loc, obj, ancestor (ax, "figure")); |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
192 set (ax, "position", pos); |
8208 | 193 |
17096 | 194 cax = __go_axes__ (hpar, "tag", "colorbar", |
195 "handlevisibility", "on", | |
196 "activepositionproperty", "position", | |
197 "position", cpos); | |
8208 | 198 addproperty ("location", cax, "radio", |
10549 | 199 "eastoutside|east|westoutside|west|northoutside|north|southoutside|south", |
200 loc); | |
8208 | 201 addproperty ("axes", cax, "handle", ax); |
202 | |
203 if (vertical) | |
204 hi = image (cax, [0,1], [cmin, cmax], [1 : clen]'); | |
205 if (mirror) | |
10549 | 206 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
17096 | 207 "ylim", cext, "ylimmode", "manual", |
208 "yaxislocation", "right", args{:}); | |
8208 | 209 else |
10549 | 210 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
17096 | 211 "ylim", cext, "ylimmode", "manual", |
212 "yaxislocation", "left", args{:}); | |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
213 endif |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
214 else |
8208 | 215 hi = image (cax, [cmin, cmax], [0,1], [1 : clen]); |
216 if (mirror) | |
10549 | 217 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
17096 | 218 "xlim", cext, "xlimmode", "manual", |
219 "xaxislocation", "top", args{:}); | |
8208 | 220 else |
10549 | 221 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
17096 | 222 "xlim", cext, "xlimmode", "manual", |
223 "xaxislocation", "bottom", args{:}); | |
8208 | 224 endif |
225 endif | |
226 | |
17096 | 227 ## Dummy object placed in axis to delete colorbar when axis is deleted. |
228 ctext = text (0, 0, "", "tag", "colorbar", | |
229 "visible", "off", "handlevisibility", "off", | |
230 "xliminclude", "off", "yliminclude", "off", | |
231 "zliminclude", "off", | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
232 "deletefcn", {@deletecolorbar, cax, obj}); |
8208 | 233 |
14777
1230d5d58d2d
Fix segfault when replacing a colorbar axis. (Bug # 36576)
Ben Abbott <bpabbott@mac.com>
parents:
14363
diff
changeset
|
234 set (cax, "deletefcn", {@resetaxis, ax, obj}); |
8208 | 235 |
17096 | 236 addlistener (hpar, "colormap", {@update_colorbar_cmap, hi, vertical, clen}); |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
237 addlistener (ax, "clim", {@update_colorbar_clim, hi, vertical}); |
17096 | 238 addlistener (ax, "dataaspectratio", {@update_colorbar_axis, cax, obj}); |
239 addlistener (ax, "dataaspectratiomode", {@update_colorbar_axis, cax, obj}); | |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
240 addlistener (ax, "plotboxaspectratio", {@update_colorbar_axis, cax, obj}); |
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
241 addlistener (ax, "plotboxaspectratiomode", {@update_colorbar_axis, cax, obj}); |
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
242 addlistener (ax, "position", {@update_colorbar_axis, cax, obj}); |
8208 | 243 |
244 endif | |
245 | |
246 if (nargout > 0) | |
247 h = cax; | |
248 endif | |
17096 | 249 |
8208 | 250 endfunction |
251 | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
252 function deletecolorbar (h, d, hc, orig_props) |
8208 | 253 ## Don't delete the colorbar and reset the axis size if the |
254 ## parent figure is being deleted. | |
17125
b5d6314314fc
Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
255 if (isaxes (hc) |
17096 | 256 && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off"))) |
8208 | 257 if (strcmp (get (hc, "beingdeleted"), "off")) |
258 delete (hc); | |
259 endif | |
11149
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
260 if (!isempty (ancestor (h, "axes")) |
fe3c3dfc07eb
style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents:
11001
diff
changeset
|
261 && strcmp (get (ancestor (h, "axes"), "beingdeleted"), "off")) |
17096 | 262 ax = ancestor (h, "axes"); |
263 units = get (ax, "units"); | |
264 set (ax, "units", orig_props.units); | |
265 set (ancestor (h, "axes"), "position", orig_props.position, | |
266 "outerposition", orig_props.outerposition, | |
267 "activepositionproperty", orig_props.activepositionproperty); | |
268 set (ax, "units", units); | |
8208 | 269 endif |
270 endif | |
271 endfunction | |
272 | |
14777
1230d5d58d2d
Fix segfault when replacing a colorbar axis. (Bug # 36576)
Ben Abbott <bpabbott@mac.com>
parents:
14363
diff
changeset
|
273 function resetaxis (cax, d, ax, orig_props) |
17125
b5d6314314fc
Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
274 if (isaxes (ax)) |
17096 | 275 ## FIXME: Probably don't want to delete everyone's listeners on colormap. |
276 dellistener (get (ax, "parent"), "colormap"); | |
277 dellistener (ax, "clim"); | |
278 dellistener (ax, "dataaspectratio"); | |
279 dellistener (ax, "dataaspectratiomode"); | |
280 dellistener (ax, "plotboxaspectratio"); | |
281 dellistener (ax, "plotboxaspectratiomode"); | |
15202
f3b5cadfd6d5
fix missing semicolons in various .m files
John W. Eaton <jwe@octave.org>
parents:
14868
diff
changeset
|
282 dellistener (ax, "position"); |
17096 | 283 |
14777
1230d5d58d2d
Fix segfault when replacing a colorbar axis. (Bug # 36576)
Ben Abbott <bpabbott@mac.com>
parents:
14363
diff
changeset
|
284 units = get (ax, "units"); |
15202
f3b5cadfd6d5
fix missing semicolons in various .m files
John W. Eaton <jwe@octave.org>
parents:
14868
diff
changeset
|
285 set (ax, "units", orig_props.units); |
17096 | 286 set (ax, "position", orig_props.position, |
287 "outerposition", orig_props.outerposition, | |
14777
1230d5d58d2d
Fix segfault when replacing a colorbar axis. (Bug # 36576)
Ben Abbott <bpabbott@mac.com>
parents:
14363
diff
changeset
|
288 "activepositionproperty", orig_props.activepositionproperty); |
15202
f3b5cadfd6d5
fix missing semicolons in various .m files
John W. Eaton <jwe@octave.org>
parents:
14868
diff
changeset
|
289 set (ax, "units", units); |
8208 | 290 endif |
291 endfunction | |
292 | |
17096 | 293 function update_colorbar_clim (hax, d, hi, vert) |
17125
b5d6314314fc
Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
294 if (isaxes (hax) |
17096 | 295 && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off"))) |
296 clen = rows (get (get (hax, "parent"), "colormap")); | |
297 cext = get (hax, "clim"); | |
8208 | 298 cdiff = (cext(2) - cext(1)) / clen / 2; |
299 cmin = cext(1) + cdiff; | |
300 cmax = cext(2) - cdiff; | |
301 | |
302 if (vert) | |
303 set (hi, "ydata", [cmin, cmax]); | |
304 set (get (hi, "parent"), "ylim", cext); | |
305 else | |
306 set (hi, "xdata", [cmin, cmax]); | |
307 set (get (hi, "parent"), "xlim", cext); | |
308 endif | |
309 endif | |
310 endfunction | |
311 | |
17096 | 312 function update_colorbar_cmap (hf, d, hi, vert, init_sz) |
313 persistent sz = init_sz; | |
314 | |
315 if (ishandle (hf) && strcmp (get (hf, "type"), "figure") | |
316 && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off"))) | |
317 clen = rows (get (hf, "colormap")); | |
318 if (clen != sz) | |
319 if (vert) | |
320 set (hi, "cdata", [1:clen]'); | |
321 else | |
322 set (hi, "cdata", [1:clen]); | |
323 endif | |
324 sz = clen; | |
325 ## Also update limits on axis or there will be white gaps | |
326 update_colorbar_clim (get (hi, "parent"), d, hi, vert); | |
327 endif | |
328 endif | |
329 endfunction | |
330 | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
331 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
|
332 |
17125
b5d6314314fc
Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
333 if (isaxes (cax) |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14777
diff
changeset
|
334 && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"),"off"))) |
8208 | 335 loc = get (cax, "location"); |
336 obj = get (h); | |
17096 | 337 obj.__cbar_hax__ = h; |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
338 obj.position = orig_props.position; |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
339 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
|
340 [pos, cpos, vertical, mirror] = ... |
10549 | 341 __position_colorbox__ (loc, obj, ancestor (h, "figure")); |
8208 | 342 |
343 if (vertical) | |
344 if (mirror) | |
10549 | 345 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
17096 | 346 "yaxislocation", "right", "position", cpos); |
8208 | 347 else |
10549 | 348 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal", |
17096 | 349 "yaxislocation", "left", "position", cpos); |
8208 | 350 endif |
351 else | |
352 if (mirror) | |
10549 | 353 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
17096 | 354 "xaxislocation", "top", "position", cpos); |
8208 | 355 else |
10549 | 356 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal", |
17096 | 357 "xaxislocation", "bottom", "position", cpos); |
8208 | 358 endif |
359 endif | |
360 | |
361 endif | |
362 endfunction | |
363 | |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
364 function [pos, cpos, vertical, mirr] = __position_colorbox__ (cbox, obj, cf) |
8208 | 365 |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
366 ## This will always represent the position prior to adding the colorbar. |
8208 | 367 pos = obj.position; |
368 sz = pos(3:4); | |
369 | |
17096 | 370 if (strcmp (obj.plotboxaspectratiomode, "manual") |
371 || strcmp (obj.dataaspectratiomode, "manual")) | |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
372 if (isempty (strfind (cbox, "outside"))) |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
373 scale = 1.0; |
8208 | 374 else |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
375 scale = 0.8; |
8208 | 376 endif |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
377 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
|
378 scale = [1, scale]; |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
379 else |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
380 scale = [scale, 1]; |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
381 endif |
11576
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
382 if (strcmp (get (cf, "__graphics_toolkit__"), "gnuplot") |
11001
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
383 && strcmp (obj.activepositionproperty, "outerposition")) |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
384 obj.outerposition = obj.outerposition .* [1, 1, scale]; |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
385 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
|
386 else |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
387 obj.position = obj.position .* [1, 1, scale]; |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10953
diff
changeset
|
388 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
|
389 endif |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
390 else |
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
391 off = 0.0; |
8208 | 392 endif |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
393 |
8208 | 394 switch (cbox) |
395 case "northoutside" | |
396 origin = pos(1:2) + [0., 0.9] .* sz + [1, -1] .* off; | |
397 sz = sz .* [1.0, 0.06]; | |
398 pos(4) = 0.8 * pos(4); | |
399 mirr = true; | |
400 vertical = false; | |
401 case "north" | |
402 origin = pos(1:2) + [0.05, 0.9] .* sz + [1, -1] .* off; | |
403 sz = sz .* [1.0, 0.06] * 0.9; | |
404 mirr = false; | |
405 vertical = false; | |
406 case "southoutside" | |
407 origin = pos(1:2) + off; | |
408 sz = sz .* [1.0, 0.06]; | |
409 pos(2) = pos(2) + pos(4) * 0.2; | |
410 pos(4) = 0.8 * pos(4); | |
411 mirr = false; | |
412 vertical = false; | |
413 case "south" | |
414 origin = pos(1:2) + [0.05, 0.05] .* sz + off; | |
415 sz = sz .* [1.0, 0.06] * 0.9; | |
416 mirr = true; | |
417 vertical = false; | |
418 case "eastoutside" | |
419 origin = pos(1:2) + [0.9, 0] .* sz + [-1, 1] .* off; | |
420 sz = sz .* [0.06, 1.0]; | |
421 pos(3) = 0.8 * pos(3); | |
422 mirr = true; | |
423 vertical = true; | |
424 case "east" | |
425 origin = pos(1:2) + [0.9, 0.05] .* sz + [-1, 1] .* off; | |
426 sz = sz .* [0.06, 1.0] * 0.9; | |
427 mirr = false; | |
428 vertical = true; | |
429 case "westoutside" | |
430 origin = pos(1:2) + off; | |
431 sz = sz .* [0.06, 1.0]; | |
432 pos(1) = pos(1) + pos(3) * 0.2; | |
433 pos(3) = 0.8 * pos(3); | |
434 mirr = false; | |
435 vertical = true; | |
436 case "west" | |
437 origin = pos(1:2) + [0.05, 0.05] .* sz + off; | |
438 sz = sz .* [0.06, 1.0] .* 0.9; | |
439 mirr = true; | |
440 vertical = true; | |
441 endswitch | |
442 | |
443 cpos = [origin, sz]; | |
444 | |
17096 | 445 if (strcmp (obj.plotboxaspectratiomode, "manual") |
446 || strcmp (obj.dataaspectratiomode, "manual")) | |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
447 obj.position = pos; |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
448 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
|
449 if (strfind (cbox, "outside")) |
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
450 scale = 1.0; |
8208 | 451 else |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
452 scale = 0.9; |
8208 | 453 endif |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10226
diff
changeset
|
454 if (sz(1) > sz(2)) |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
455 ## 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
|
456 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
|
457 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
|
458 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
|
459 else |
10558
23c1910dbd8e
Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents:
10549
diff
changeset
|
460 ## 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
|
461 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
|
462 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
|
463 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
|
464 endif |
8208 | 465 endif |
8101
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
466 |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
467 endfunction |
86955a1559c5
improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents:
7726
diff
changeset
|
468 |
7726
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
469 |
1b954fdaf4ff
Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents:
7264
diff
changeset
|
470 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
471 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
472 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
473 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
474 %! imagesc (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
|
475 %! colorbar (); |
17190
df4c4b7708a4
Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents:
17125
diff
changeset
|
476 %! title ('colorbar() example'); |
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
|
477 |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
478 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
479 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
480 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
481 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
482 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
483 %! colorbar ('westoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
484 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
485 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
486 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
487 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
488 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
489 %! imagesc (x); |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14247
diff
changeset
|
490 %! colorbar ('peer', gca, 'northoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
491 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
492 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
493 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
494 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
495 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
496 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
497 %! colorbar ('southoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
498 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
499 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
500 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
501 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
502 %! contour (peaks ()); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
503 %! colorbar ('west'); |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
504 |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
505 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
506 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
507 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
508 %! subplot (2,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
509 %! contour (peaks ()); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
510 %! colorbar ('east'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
511 %! subplot (2,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
512 %! contour (peaks ()); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
513 %! colorbar ('west'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
514 %! subplot (2,2,3); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
515 %! contour (peaks ()); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
516 %! colorbar ('north'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
517 %! subplot (2,2,4); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
518 %! contour (peaks ()); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
519 %! colorbar ('south'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
520 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
521 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
522 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
523 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
524 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
525 %! subplot (2,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
526 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
527 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
528 %! subplot (2,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
529 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
530 %! colorbar ('westoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
531 %! subplot (2,2,3); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
532 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
533 %! colorbar ('northoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
534 %! subplot (2,2,4); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
535 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
536 %! colorbar ('southoutside'); |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9262
diff
changeset
|
537 |
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
|
538 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
539 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
540 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
541 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
542 %! subplot (1,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
543 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
544 %! axis square; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
545 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
546 %! subplot (1,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
547 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
548 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
549 %! colorbar ('westoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
550 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
551 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
552 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
553 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
554 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
555 %! subplot (1,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
556 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
557 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
558 %! colorbar ('northoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
559 %! subplot (1,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
560 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
561 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
562 %! colorbar ('southoutside'); |
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 |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
565 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
566 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
567 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
568 %! subplot (2,1,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
569 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
570 %! axis square; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
571 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
572 %! subplot (2,1,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
573 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
574 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
575 %! colorbar ('westoutside'); |
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
|
576 |
0d9f925b9705
colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
577 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
578 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
579 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
580 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
581 %! subplot (2,1,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
582 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
583 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
584 %! colorbar ('northoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
585 %! subplot (2,1,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
586 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
587 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
588 %! colorbar ('southoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
589 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
590 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
591 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
592 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
593 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
594 %! subplot (1,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
595 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
596 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
597 %! subplot (1,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
598 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
599 %! colorbar ('westoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
600 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
601 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
602 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
603 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
604 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
605 %! subplot (1,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
606 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
607 %! colorbar ('northoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
608 %! subplot (1,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
609 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
610 %! colorbar ('southoutside'); |
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
|
611 |
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 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
613 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
614 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
615 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
616 %! subplot (2,1,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
617 %! imagesc (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
618 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
619 %! subplot (2,1,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
620 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
621 %! colorbar ('westoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
622 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
623 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
624 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
625 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
626 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
627 %! subplot (2,1,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
628 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
629 %! colorbar ('northoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
630 %! subplot (2,1,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
631 %! imagesc (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
632 %! colorbar ('southoutside'); |
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
|
633 |
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
|
634 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
635 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
636 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
637 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
638 %! subplot (1,2,1); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
639 %! contour (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
640 %! axis square; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
641 %! colorbar ('east'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
642 %! xlim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
643 %! ylim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
644 %! subplot (1,2,2); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
645 %! contour (x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
646 %! colorbar ('west'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
647 %! xlim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
648 %! ylim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
649 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
650 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
651 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
652 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
653 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
654 %! contour (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
655 %! xlim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
656 %! ylim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
657 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
658 %! colorbar off; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
659 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
660 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
661 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
662 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
663 %! n = 64; x = kron (1:n, ones (n,1)); x = abs (x - x.'); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
664 %! contour (x); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
665 %! xlim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
666 %! ylim ([1, 64]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
667 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
668 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
669 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
670 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
671 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
672 %! imagesc (1 ./ hilb (99)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
673 %! h = colorbar (); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
674 %! set (h, 'yscale', 'log'); |
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
|
675 |
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
|
676 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
677 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
678 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
679 %! imagesc (log10 (1 ./ hilb (99))); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
680 %! h = colorbar (); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
681 %! ytick = get (h, 'ytick'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
682 %! set (h, 'yticklabel', sprintf ('10^{%g}|', ytick)); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
683 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
684 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
685 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
686 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
687 %! n = 5; x = linspace (0,5,n); y = linspace (0,1,n); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
688 %! imagesc (1 ./ hilb (n)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
689 %! axis equal; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
690 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
691 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
692 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
693 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
694 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
695 %! n = 5; x = linspace (0,5,n); y = linspace (0,1,n); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
696 %! imagesc (x, y, 1 ./ hilb (n)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
697 %! axis equal; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
698 %! 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
|
699 |
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
|
700 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
701 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
702 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
703 %! n = 5; x = linspace (0,5,n); y = linspace (0,1,n); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
704 %! imagesc (y, x, 1 ./ hilb (n)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
705 %! axis equal; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
706 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
707 |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
708 ## This requires that the axes position be properly determined for 'axis equal' |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
709 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
710 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
711 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
712 %! axes; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
713 %! colorbar (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
714 %! hold on; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
715 %! contour (peaks ()); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
716 %! hold off; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
717 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
718 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
719 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
720 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
721 %! plot ([0, 2]); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
722 %! colorbar ('east'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
723 %! axis square; |
10910
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
724 |
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10821
diff
changeset
|
725 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
726 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
727 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
728 %! plot ([0, 2]); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
729 %! colorbar ('eastoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
730 %! axis square; |
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
|
731 |
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
|
732 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
733 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
734 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
735 %! pcolor (peaks (20)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
736 %! shading interp; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
737 %! axis ('tight', 'square'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
738 %! colorbar (); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
739 #%! axes ('color','none','box','on','activepositionproperty','position'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
740 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
741 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
742 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
743 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
744 %! plot ([0, 2]); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
745 %! colorbar ('east'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
746 %! axis equal; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
747 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
748 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
749 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
750 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
751 %! plot ([0, 2]); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
752 %! colorbar ('eastoutside'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
753 %! axis equal; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
754 |