annotate scripts/plot/draw/colorbar.m @ 17572:7bb76a22cde1

maint: Split scripts/plot directory into 4 pieces. scripts/gui : user-interface functions scripts/plot/appearance : functions controlling plot appearance scripts/plot/draw : plotting functions which produce graphs scripts/plot/util : low-level plotting functions and utilities. * scripts/gui/guidata.m, scripts/gui/guihandles.m, scripts/gui/module.mk, scripts/gui/private/__file_filter__.m, scripts/gui/private/__fltk_file_filter__.m, scripts/gui/private/__is_function__.m, scripts/gui/private/__uigetdir_fltk__.m, scripts/gui/private/__uigetfile_fltk__.m, scripts/gui/private/__uiobject_split_args__.m, scripts/gui/private/__uiputfile_fltk__.m, scripts/gui/uicontextmenu.m, scripts/gui/uicontrol.m, scripts/gui/uigetdir.m, scripts/gui/uigetfile.m, scripts/gui/uimenu.m, scripts/gui/uipanel.m, scripts/gui/uipushtool.m, scripts/gui/uiputfile.m, scripts/gui/uiresume.m, scripts/gui/uitoggletool.m, scripts/gui/uitoolbar.m, scripts/gui/uiwait.m, scripts/gui/waitbar.m, scripts/gui/waitforbuttonpress.m: Moved from scripts/plot to scripts/gui * scripts/plot/appearance/__clabel__.m, scripts/plot/appearance/__getlegenddata__.m, scripts/plot/appearance/axis.m, scripts/plot/appearance/box.m, scripts/plot/appearance/caxis.m, scripts/plot/appearance/clabel.m, scripts/plot/appearance/daspect.m, scripts/plot/appearance/diffuse.m, scripts/plot/appearance/grid.m, scripts/plot/appearance/gtext.m, scripts/plot/appearance/hidden.m, scripts/plot/appearance/legend.m, scripts/plot/appearance/orient.m, scripts/plot/appearance/pbaspect.m, scripts/plot/appearance/private/__axis_label__.m, scripts/plot/appearance/private/__axis_limits__.m, scripts/plot/appearance/shading.m, scripts/plot/appearance/specular.m, scripts/plot/appearance/text.m, scripts/plot/appearance/title.m, scripts/plot/appearance/view.m, scripts/plot/appearance/whitebg.m, scripts/plot/appearance/xlabel.m, scripts/plot/appearance/xlim.m, scripts/plot/appearance/ylabel.m, scripts/plot/appearance/ylim.m, scripts/plot/appearance/zlabel.m, scripts/plot/appearance/zlim.m: Moved from scripts/plot to subdir appearance. * scripts/plot/draw/area.m, scripts/plot/draw/bar.m, scripts/plot/draw/barh.m, scripts/plot/draw/colorbar.m, scripts/plot/draw/comet.m, scripts/plot/draw/comet3.m, scripts/plot/draw/compass.m, scripts/plot/draw/contour.m, scripts/plot/draw/contour3.m, scripts/plot/draw/contourc.m, scripts/plot/draw/contourf.m, scripts/plot/draw/cylinder.m, scripts/plot/draw/ellipsoid.m, scripts/plot/draw/errorbar.m, scripts/plot/draw/ezcontour.m, scripts/plot/draw/ezcontourf.m, scripts/plot/draw/ezmesh.m, scripts/plot/draw/ezmeshc.m, scripts/plot/draw/ezplot.m, scripts/plot/draw/ezplot3.m, scripts/plot/draw/ezpolar.m, scripts/plot/draw/ezsurf.m, scripts/plot/draw/ezsurfc.m, scripts/plot/draw/feather.m, scripts/plot/draw/fill.m, scripts/plot/draw/fplot.m, scripts/plot/draw/hist.m, scripts/plot/draw/isocolors.m, scripts/plot/draw/isonormals.m, scripts/plot/draw/isosurface.m, scripts/plot/draw/line.m, scripts/plot/draw/loglog.m, scripts/plot/draw/loglogerr.m, scripts/plot/draw/mesh.m, scripts/plot/draw/meshc.m, scripts/plot/draw/meshz.m, scripts/plot/draw/pareto.m, scripts/plot/draw/patch.m, scripts/plot/draw/pcolor.m, scripts/plot/draw/peaks.m, scripts/plot/draw/pie.m, scripts/plot/draw/pie3.m, scripts/plot/draw/plot.m, scripts/plot/draw/plot3.m, scripts/plot/draw/plotmatrix.m, scripts/plot/draw/plotyy.m, scripts/plot/draw/polar.m, scripts/plot/draw/private/__add_datasource__.m, scripts/plot/draw/private/__bar__.m, scripts/plot/draw/private/__contour__.m, scripts/plot/draw/private/__errcomm__.m, scripts/plot/draw/private/__errplot__.m, scripts/plot/draw/private/__ezplot__.m, scripts/plot/draw/private/__interp_cube__.m, scripts/plot/draw/private/__line__.m, scripts/plot/draw/private/__marching_cube__.m, scripts/plot/draw/private/__patch__.m, scripts/plot/draw/private/__pie__.m, scripts/plot/draw/private/__plt__.m, scripts/plot/draw/private/__quiver__.m, scripts/plot/draw/private/__scatter__.m, scripts/plot/draw/private/__stem__.m, scripts/plot/draw/quiver.m, scripts/plot/draw/quiver3.m, scripts/plot/draw/rectangle.m, scripts/plot/draw/ribbon.m, scripts/plot/draw/rose.m, scripts/plot/draw/scatter.m, scripts/plot/draw/scatter3.m, scripts/plot/draw/semilogx.m, scripts/plot/draw/semilogxerr.m, scripts/plot/draw/semilogy.m, scripts/plot/draw/semilogyerr.m, scripts/plot/draw/shrinkfaces.m, scripts/plot/draw/slice.m, scripts/plot/draw/sombrero.m, scripts/plot/draw/sphere.m, scripts/plot/draw/stairs.m, scripts/plot/draw/stem.m, scripts/plot/draw/stem3.m, scripts/plot/draw/stemleaf.m, scripts/plot/draw/surf.m, scripts/plot/draw/surface.m, scripts/plot/draw/surfc.m, scripts/plot/draw/surfl.m, scripts/plot/draw/surfnorm.m, scripts/plot/draw/tetramesh.m, scripts/plot/draw/trimesh.m, scripts/plot/draw/triplot.m, scripts/plot/draw/trisurf.m, scripts/plot/draw/waterfall.m: Moved from plot/ to subdir draw. * scripts/plot/util/__actual_axis_position__.m, scripts/plot/util/__default_plot_options__.m, scripts/plot/util/__gnuplot_drawnow__.m, scripts/plot/util/__next_line_color__.m, scripts/plot/util/__next_line_style__.m, scripts/plot/util/__plt_get_axis_arg__.m, scripts/plot/util/__pltopt__.m, scripts/plot/util/allchild.m, scripts/plot/util/ancestor.m, scripts/plot/util/axes.m, scripts/plot/util/cla.m, scripts/plot/util/clf.m, scripts/plot/util/close.m, scripts/plot/util/closereq.m, scripts/plot/util/colstyle.m, scripts/plot/util/copyobj.m, scripts/plot/util/figure.m, scripts/plot/util/findall.m, scripts/plot/util/findfigs.m, scripts/plot/util/findobj.m, scripts/plot/util/gca.m, scripts/plot/util/gcbf.m, scripts/plot/util/gcbo.m, scripts/plot/util/gcf.m, scripts/plot/util/gco.m, scripts/plot/util/ginput.m, scripts/plot/util/gnuplot_binary.in, scripts/plot/util/graphics_toolkit.m, scripts/plot/util/hdl2struct.m, scripts/plot/util/hggroup.m, scripts/plot/util/hold.m, scripts/plot/util/isaxes.m, scripts/plot/util/isfigure.m, scripts/plot/util/ishghandle.m, scripts/plot/util/ishold.m, scripts/plot/util/isprop.m, scripts/plot/util/linkprop.m, scripts/plot/util/meshgrid.m, scripts/plot/util/ndgrid.m, scripts/plot/util/newplot.m, scripts/plot/util/print.m, scripts/plot/util/printd.m, scripts/plot/util/private/__add_default_menu__.m, scripts/plot/util/private/__fltk_ginput__.m, scripts/plot/util/private/__fltk_print__.m, scripts/plot/util/private/__ghostscript__.m, scripts/plot/util/private/__gnuplot_get_var__.m, scripts/plot/util/private/__gnuplot_ginput__.m, scripts/plot/util/private/__gnuplot_has_feature__.m, scripts/plot/util/private/__gnuplot_has_terminal__.m, scripts/plot/util/private/__gnuplot_open_stream__.m, scripts/plot/util/private/__gnuplot_print__.m, scripts/plot/util/private/__gnuplot_version__.m, scripts/plot/util/private/__go_draw_axes__.m, scripts/plot/util/private/__go_draw_figure__.m, scripts/plot/util/private/__print_parse_opts__.m, scripts/plot/util/private/__tight_eps_bbox__.m, scripts/plot/util/refresh.m, scripts/plot/util/refreshdata.m, scripts/plot/util/saveas.m, scripts/plot/util/shg.m, scripts/plot/util/struct2hdl.m, scripts/plot/util/subplot.m: Moved from plot to subdir util. * etc/HACKING: Updated directory structure info. * scripts/Makefile.am, scripts/plot/appearance/module.mk, scripts/plot/draw/module.mk, scripts/plot/util/module.mk: Added new directories to build system.
author Rik <rik@octave.org>
date Fri, 04 Oct 2013 17:09:08 -0700
parents scripts/plot/colorbar.m@95bfa04ab514
children 4d8ddc44d1f2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
2 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
3 ## This file is part of Octave.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
4 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
8 ## your option) any later version.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
9 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
13 ## General Public License for more details.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
14 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
18
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
19 ## -*- texinfo -*-
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17096
diff changeset
20 ## @deftypefn {Command} {} colorbar
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
21 ## @deftypefnx {Function File} {} colorbar (@var{loc})
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
22 ## @deftypefnx {Function File} {} colorbar (@var{delete_option})
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
23 ## @deftypefnx {Function File} {} colorbar (@var{hcb}, @dots{})
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
24 ## @deftypefnx {Function File} {} colorbar (@var{hax}, @dots{})
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
25 ## @deftypefnx {Function File} {} colorbar (@dots{}, "peer", @var{hax}, @dots{})
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
26 ## @deftypefnx {Function File} {} colorbar (@dots{}, "location", @var{loc}, @dots{})
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
27 ## @deftypefnx {Function File} {} colorbar (@dots{}, @var{prop}, @var{val}, @dots{})
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
28 ## @deftypefnx {Function File} {@var{h} =} colorbar (@dots{})
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
29 ## Add a colorbar to the current axes.
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
30 ##
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
31 ## A colorbar displays the current colormap along with numerical rulings
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
32 ## so that the color scale can be interpreted.
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
33 ##
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
34 ## The optional input @var{loc} determines the location of the colorbar.
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
35 ## Valid values for @var{loc} are
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
36 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
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
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
60 ## Place the colorbar at the bottom of the plot.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
61 ## @end table
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
62 ##
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
68 ## If the first argument @var{hax} is an axes handle, then the colorbar is
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
69 ## added to this axis, rather than the current axes returned by @code{gca}.
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
70 ##
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
71 ## If the first argument @var{hcb} is a handle to a colorbar object, then
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
72 ## operate on this colorbar directly.
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
73 ##
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
74 ## Additional property/value pairs are passed directly to the underlying axes
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
75 ## object.
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
76 ##
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
77 ## The optional return value @var{h} is a graphics handle to the created
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
78 ## colorbar object.
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
79 ##
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
84 ## @seealso{colormap}
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
85 ## @end deftypefn
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
86
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
87 function h = colorbar (varargin)
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
88
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
89 [hcb, varargin, nargin] = __plt_get_axis_arg__ ("colorbar", varargin{:});
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
90
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
91 if (hcb && ! strcmp (get (hcb, "tag"), "colorbar"))
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
92 ax = hcb;
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
93 hcb = [];
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
94 else
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
95 ax = [];
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
96 endif
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
97 loc = "";
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
98 args = {};
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
99 deleting = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
100
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
101 i = 1;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
102 while (i <= nargin)
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
105 switch (tolower (arg))
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
106 case "peer"
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
107 if (i > nargin)
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
108 error ('colorbar: missing axes handle after "peer"');
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
109 else
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
112 error ('colorbar: expecting an axes handle following "peer"');
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
113 endif
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10534
diff changeset
114 endif
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
115 case {"north", "south", "east", "west",
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
116 "northoutside", "southoutside", "eastoutside", "westoutside"}
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
117 loc = tolower (arg);
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
118 case "location"
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
119 if (i > nargin)
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
120 error ('colorbar: missing value after "location"');
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
121 else
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
122 loc = tolower (varargin{i++});
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
123 endif
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
124 case {"delete", "hide", "off", "none"}
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
125 deleting = true;
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
126 otherwise
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
127 args{end+1} = arg;
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
128 endswitch
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
129 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
130 args{end+1} = arg;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
131 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
132 endwhile
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
133
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
134 ## Handle changes to existing colorbar
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
135 if (! isempty (hcb))
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
136 if (deleting)
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
137 delete (hcb);
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
138 if (nargout > 0)
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
139 h = hcb;
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
140 endif
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
141 return;
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
142 else
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
143 ## FIXME: No listener on location property so have to re-create
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
144 ## colorbar whenever an option changes.
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
145 ## re-instate this code if listener is developed.
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
146 # if (! isempty (loc))
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
147 # set (hcb, "location", loc);
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
148 # endif
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
149 # if (! isempty (args))
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
150 # set (hcb, args{:});
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
151 # endif
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
152 ax = get (get (hcb, "parent"), "currrentaxes");
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
153 endif
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
154 endif
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
155
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
156 if (isempty (loc))
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
157 loc = "eastoutside";
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
158 endif
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
159 if (isempty (ax))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
160 ax = gca ();
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
161 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
175 ## FIXME: Matlab does not require the "position" property to be active.
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
176 ## Is there a way to determine the plotbox position for the
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
180 obj.__cbar_hax__ = ax;
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
181 position = obj.position;
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
182 ## FIXME: Should this be ancestor to accommodate hggroups?
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
183 hpar = get (ax, "parent");
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
184 clen = rows (get (hpar, "colormap"));
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
185 cext = get (ax, "clim");
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
186 cdiff = (cext(2) - cext(1)) / clen / 2;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
187 cmin = cext(1) + cdiff;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
188 cmax = cext(2) - cdiff;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10534
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
193
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
194 cax = __go_axes__ (hpar, "tag", "colorbar",
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
195 "handlevisibility", "on",
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
196 "activepositionproperty", "position",
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
197 "position", cpos);
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
198 addproperty ("location", cax, "radio",
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10534
diff changeset
199 "eastoutside|east|westoutside|west|northoutside|north|southoutside|south",
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10534
diff changeset
200 loc);
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
201 addproperty ("axes", cax, "handle", ax);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
202
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
203 if (vertical)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
204 hi = image (cax, [0,1], [cmin, cmax], [1 : clen]');
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
205 if (mirror)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10534
diff changeset
206 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal",
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
207 "ylim", cext, "ylimmode", "manual",
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
208 "yaxislocation", "right", args{:});
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
209 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10534
diff changeset
210 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal",
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
211 "ylim", cext, "ylimmode", "manual",
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
215 hi = image (cax, [cmin, cmax], [0,1], [1 : clen]);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
216 if (mirror)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10534
diff changeset
217 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal",
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
218 "xlim", cext, "xlimmode", "manual",
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
219 "xaxislocation", "top", args{:});
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
220 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10534
diff changeset
221 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal",
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
222 "xlim", cext, "xlimmode", "manual",
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
223 "xaxislocation", "bottom", args{:});
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
224 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
225 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
226
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
227 ## Dummy object placed in axis to delete colorbar when axis is deleted.
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
228 ctext = text (0, 0, "", "tag", "colorbar",
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
229 "visible", "off", "handlevisibility", "off",
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
230 "xliminclude", "off", "yliminclude", "off",
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
235
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
238 addlistener (ax, "dataaspectratio", {@update_colorbar_axis, cax, obj});
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
243
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
244 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
245
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
246 if (nargout > 0)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
247 h = cax;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
248 endif
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
249
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
250 endfunction
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
253 ## Don't delete the colorbar and reset the axis size if the
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
256 && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off")))
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
257 if (strcmp (get (hc, "beingdeleted"), "off"))
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
258 delete (hc);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
262 ax = ancestor (h, "axes");
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
263 units = get (ax, "units");
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
264 set (ax, "units", orig_props.units);
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
265 set (ancestor (h, "axes"), "position", orig_props.position,
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
266 "outerposition", orig_props.outerposition,
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
267 "activepositionproperty", orig_props.activepositionproperty);
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
268 set (ax, "units", units);
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
269 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
270 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
271 endfunction
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
275 ## FIXME: Probably don't want to delete everyone's listeners on colormap.
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
276 dellistener (get (ax, "parent"), "colormap");
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
277 dellistener (ax, "clim");
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
278 dellistener (ax, "dataaspectratio");
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
279 dellistener (ax, "dataaspectratiomode");
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
280 dellistener (ax, "plotboxaspectratio");
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
286 set (ax, "position", orig_props.position,
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
290 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
291 endfunction
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
292
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
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
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
295 && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off")))
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
296 clen = rows (get (get (hax, "parent"), "colormap"));
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
297 cext = get (hax, "clim");
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
298 cdiff = (cext(2) - cext(1)) / clen / 2;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
299 cmin = cext(1) + cdiff;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
300 cmax = cext(2) - cdiff;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
301
17412
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
302 hiax = get (hi, "parent");
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
303 if (vert)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
304 set (hi, "ydata", [cmin, cmax]);
17412
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
305 set (hiax, "ylim", cext);
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
306 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
307 set (hi, "xdata", [cmin, cmax]);
17412
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
308 set (hiax, "xlim", cext);
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
309 endif
17412
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
310
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
311 ## FIXME: Setting xlim or ylim from within a listener callback
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
312 ## causes the axis to change size rather than change limits.
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
313 ## Workaround it by jiggling the position property which forces
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
314 ## a redraw of the axis object.
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
315 ##
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
316 ## Debug Example:
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
317 ## Uncomment the line below.
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
318 ## keyboard;
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
319 ## Now run the the following code.
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
320 ## clf; colorbar (); contour (peaks ())
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
321 ## Once the keyboard command has been hit in the debugger try
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
322 ## set (hiax, "ylim", [0 0.5])
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
323 pos = get (hiax, "position");
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
324 pos(1) += eps;
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
325 set (hiax, "position", pos);
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
326 pos(1) -= eps;
95bfa04ab514 Fix bug in colorbar demo #24.
Rik <rik@octave.org>
parents: 17281
diff changeset
327 set (hiax, "position", pos);
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
328 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
329 endfunction
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
330
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
331 function update_colorbar_cmap (hf, d, hi, vert, init_sz)
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
332 persistent sz = init_sz;
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
333
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
334 if (ishandle (hf) && strcmp (get (hf, "type"), "figure")
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
335 && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off")))
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
336 clen = rows (get (hf, "colormap"));
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
337 if (clen != sz)
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
338 if (vert)
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
339 set (hi, "cdata", [1:clen]');
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
340 else
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
341 set (hi, "cdata", [1:clen]);
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
342 endif
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
343 sz = clen;
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
344 ## Also update limits on axis or there will be white gaps
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
345 update_colorbar_clim (get (hi, "parent"), d, hi, vert);
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
346 endif
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
347 endif
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
348 endfunction
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
349
10558
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
350 function update_colorbar_axis (h, d, cax, orig_props)
17125
b5d6314314fc Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents: 17122
diff changeset
351 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
352 && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"),"off")))
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
353 loc = get (cax, "location");
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
354 obj = get (h);
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
355 obj.__cbar_hax__ = h;
10558
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
356 obj.position = orig_props.position;
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
357 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
358 [pos, cpos, vertical, mirror] = ...
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10534
diff changeset
359 __position_colorbox__ (loc, obj, ancestor (h, "figure"));
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
360
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
361 if (vertical)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
362 if (mirror)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10534
diff changeset
363 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal",
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
364 "yaxislocation", "right", "position", cpos);
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
365 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10534
diff changeset
366 set (cax, "xtick", [], "xdir", "normal", "ydir", "normal",
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
367 "yaxislocation", "left", "position", cpos);
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
368 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
369 else
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
370 if (mirror)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10534
diff changeset
371 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal",
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
372 "xaxislocation", "top", "position", cpos);
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
373 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10534
diff changeset
374 set (cax, "ytick", [], "xdir", "normal", "ydir", "normal",
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
375 "xaxislocation", "bottom", "position", cpos);
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
376 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
377 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
378
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
379 endif
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
380 endfunction
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
381
10532
568c7c041fac colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents: 10226
diff changeset
382 function [pos, cpos, vertical, mirr] = __position_colorbox__ (cbox, obj, cf)
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
383
10558
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
384 ## This will always represent the position prior to adding the colorbar.
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
385 pos = obj.position;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
386 sz = pos(3:4);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
387
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
388 if (strcmp (obj.plotboxaspectratiomode, "manual")
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
389 || strcmp (obj.dataaspectratiomode, "manual"))
10558
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
390 if (isempty (strfind (cbox, "outside")))
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
391 scale = 1.0;
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
392 else
10558
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
393 scale = 0.8;
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
394 endif
10558
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
395 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
396 scale = [1, scale];
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
397 else
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
398 scale = [scale, 1];
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
399 endif
11576
8ac9687dbe9f rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
400 if (strcmp (get (cf, "__graphics_toolkit__"), "gnuplot")
11001
2ab8cc6dcced Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents: 10953
diff changeset
401 && strcmp (obj.activepositionproperty, "outerposition"))
2ab8cc6dcced Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents: 10953
diff changeset
402 obj.outerposition = obj.outerposition .* [1, 1, scale];
2ab8cc6dcced Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents: 10953
diff changeset
403 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
404 else
2ab8cc6dcced Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents: 10953
diff changeset
405 obj.position = obj.position .* [1, 1, scale];
2ab8cc6dcced Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents: 10953
diff changeset
406 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
407 endif
10558
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
408 else
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
409 off = 0.0;
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
410 endif
8101
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
411
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
412 switch (cbox)
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
413 case "northoutside"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
414 origin = pos(1:2) + [0., 0.9] .* sz + [1, -1] .* off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
415 sz = sz .* [1.0, 0.06];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
416 pos(4) = 0.8 * pos(4);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
417 mirr = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
418 vertical = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
419 case "north"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
420 origin = pos(1:2) + [0.05, 0.9] .* sz + [1, -1] .* off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
421 sz = sz .* [1.0, 0.06] * 0.9;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
422 mirr = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
423 vertical = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
424 case "southoutside"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
425 origin = pos(1:2) + off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
426 sz = sz .* [1.0, 0.06];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
427 pos(2) = pos(2) + pos(4) * 0.2;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
428 pos(4) = 0.8 * pos(4);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
429 mirr = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
430 vertical = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
431 case "south"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
432 origin = pos(1:2) + [0.05, 0.05] .* sz + off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
433 sz = sz .* [1.0, 0.06] * 0.9;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
434 mirr = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
435 vertical = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
436 case "eastoutside"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
437 origin = pos(1:2) + [0.9, 0] .* sz + [-1, 1] .* off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
438 sz = sz .* [0.06, 1.0];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
439 pos(3) = 0.8 * pos(3);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
440 mirr = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
441 vertical = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
442 case "east"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
443 origin = pos(1:2) + [0.9, 0.05] .* sz + [-1, 1] .* off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
444 sz = sz .* [0.06, 1.0] * 0.9;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
445 mirr = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
446 vertical = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
447 case "westoutside"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
448 origin = pos(1:2) + off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
449 sz = sz .* [0.06, 1.0];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
450 pos(1) = pos(1) + pos(3) * 0.2;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
451 pos(3) = 0.8 * pos(3);
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
452 mirr = false;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
453 vertical = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
454 case "west"
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
455 origin = pos(1:2) + [0.05, 0.05] .* sz + off;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
456 sz = sz .* [0.06, 1.0] .* 0.9;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
457 mirr = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
458 vertical = true;
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
459 endswitch
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
460
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
461 cpos = [origin, sz];
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
462
17096
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
463 if (strcmp (obj.plotboxaspectratiomode, "manual")
33037eddecd2 Overhaul colorbar function.
Rik <rik@octave.org>
parents: 15202
diff changeset
464 || 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
465 obj.position = pos;
568c7c041fac colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents: 10226
diff changeset
466 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
467 if (strfind (cbox, "outside"))
568c7c041fac colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents: 10226
diff changeset
468 scale = 1.0;
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
469 else
10532
568c7c041fac colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents: 10226
diff changeset
470 scale = 0.9;
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
471 endif
10532
568c7c041fac colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents: 10226
diff changeset
472 if (sz(1) > sz(2))
10558
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
473 ## 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
474 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
475 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
476 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
477 else
10558
23c1910dbd8e Fix colorbar() bugs for manual plotboxaspectratio.
Ben Abbott <bpabbott@mac.com>
parents: 10549
diff changeset
478 ## 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
479 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
480 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
481 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
482 endif
8208
f6ca8ff51818 [mq]: graphics-backend
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
483 endif
8101
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
484
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
485 endfunction
86955a1559c5 improve speed of cell2mat
David Bateman <dbateman@free.fr>
parents: 7726
diff changeset
486
7726
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
487
1b954fdaf4ff Try to get the colorbar position right for manual aspect ratios as well
David Bateman <dbateman@free.fr>
parents: 7264
diff changeset
488 %!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
489 %! 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
490 %! 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
491 %! 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
492 %! 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
493 %! colorbar ();
17190
df4c4b7708a4 Add titles and clean-up plotting %!demos.
Rik <rik@octave.org>
parents: 17125
diff changeset
494 %! 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
495
9281
02b16eeb3167 Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents: 9262
diff changeset
496 %!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
497 %! 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
498 %! 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
499 %! 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
500 %! imagesc (x);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
501 %! 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
502
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
503 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
504 %! 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
505 %! 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
506 %! 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
507 %! imagesc (x);
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14247
diff changeset
508 %! 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
509
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
510 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
511 %! 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
512 %! 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
513 %! 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
514 %! imagesc (x);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
515 %! 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
516
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
517 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
518 %! 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
519 %! 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
520 %! contour (peaks ());
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
521 %! colorbar ('west');
9281
02b16eeb3167 Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents: 9262
diff changeset
522
02b16eeb3167 Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents: 9262
diff changeset
523 %!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
524 %! 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
525 %! 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
526 %! 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
527 %! contour (peaks ());
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
528 %! 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
529 %! 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
530 %! contour (peaks ());
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
531 %! 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
532 %! 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
533 %! contour (peaks ());
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
534 %! 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
535 %! 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
536 %! contour (peaks ());
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
537 %! 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
538
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
539 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
540 %! 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
541 %! 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
542 %! 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
543 %! 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
544 %! 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
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 (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
547 %! imagesc (x);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
548 %! 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
549 %! 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
550 %! imagesc (x);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
551 %! 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
552 %! 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
553 %! imagesc (x);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
554 %! colorbar ('southoutside');
9281
02b16eeb3167 Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents: 9262
diff changeset
555
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
556 %!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
557 %! 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
558 %! 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
559 %! 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
560 %! 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
561 %! 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
562 %! 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
563 %! colorbar ();
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
564 %! 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
565 %! 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
566 %! axis square;
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
567 %! 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
568
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
569 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
570 %! 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
571 %! 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
572 %! 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
573 %! 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
574 %! 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
575 %! axis square;
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
576 %! 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
577 %! 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
578 %! 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
579 %! axis square;
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
580 %! 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
581
0d9f925b9705 colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents: 9281
diff changeset
582 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
583 %! 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
584 %! 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
585 %! 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
586 %! 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
587 %! 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
588 %! 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
589 %! colorbar ();
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
590 %! 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
591 %! 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
592 %! axis square;
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
593 %! 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
594
0d9f925b9705 colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
Ben Abbott <bpabbott@mac.com>
parents: 9281
diff changeset
595 %!demo
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
596 %! 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
597 %! 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
598 %! 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
599 %! 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
600 %! 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
601 %! axis square;
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
602 %! 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
603 %! 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
604 %! 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
605 %! axis square;
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
606 %! 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
607
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
608 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
609 %! 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
610 %! 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
611 %! 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
612 %! 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
613 %! 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
614 %! colorbar ();
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
615 %! 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
616 %! imagesc (x);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
617 %! 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
618
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
619 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
620 %! 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
621 %! 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
622 %! 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
623 %! 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
624 %! imagesc (x);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
625 %! 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
626 %! 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
627 %! imagesc (x);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
628 %! 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
629
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
630 %!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
631 %! 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
632 %! 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
633 %! 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
634 %! 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
635 %! 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
636 %! colorbar ();
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
637 %! 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
638 %! imagesc (x);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
639 %! 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
640
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
641 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
642 %! 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
643 %! 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
644 %! 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
645 %! 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
646 %! imagesc (x);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
647 %! 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
648 %! 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
649 %! imagesc (x);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
650 %! 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
651
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
652 %!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
653 %! 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
654 %! 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
655 %! 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
656 %! 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
657 %! 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
658 %! axis square;
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
659 %! 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
660 %! 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
661 %! 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
662 %! 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
663 %! contour (x);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
664 %! 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
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
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
668 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
669 %! 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
670 %! 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
671 %! 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
672 %! 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
673 %! 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
674 %! 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
675 %! colorbar ();
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
676 %! 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
677
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
678 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
679 %! 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
680 %! 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
681 %! 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
682 %! 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
683 %! 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
684 %! 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
685 %! colorbar ();
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
686
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
687 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
688 %! 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
689 %! 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
690 %! 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
691 %! h = colorbar ();
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
692 %! 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
693
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
694 %!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
695 %! 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
696 %! 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
697 %! 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
698 %! h = colorbar ();
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
699 %! ytick = get (h, 'ytick');
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
700 %! 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
701
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
702 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
703 %! 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
704 %! 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
705 %! 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
706 %! 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
707 %! 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
708 %! colorbar ();
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
709
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
710 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
711 %! 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
712 %! 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
713 %! 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
714 %! 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
715 %! 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
716 %! 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
717
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
718 %!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
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 %! 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
722 %! 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
723 %! 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
724 %! colorbar ();
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
725
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
726 ## 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
727 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
728 %! 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
729 %! 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
730 %! axes;
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
731 %! colorbar ();
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
732 %! 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
733 %! 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
734 %! 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
735
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
736 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
737 %! 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
738 %! 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
739 %! plot ([0, 2]);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
740 %! 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
741 %! axis square;
10910
40cf7cc4ea62 Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents: 10821
diff changeset
742
40cf7cc4ea62 Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents: 10821
diff changeset
743 %!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
744 %! 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
745 %! 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
746 %! plot ([0, 2]);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
747 %! 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
748 %! 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
749
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
750 %!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
751 %! 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
752 %! 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
753 %! 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
754 %! shading interp;
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
755 %! 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
756 %! colorbar ();
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
757 #%! 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
758
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
759 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
760 %! 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
761 %! 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
762 %! plot ([0, 2]);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
763 %! 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
764 %! 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
765
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
766 %!demo
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
767 %! 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
768 %! 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
769 %! plot ([0, 2]);
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
770 %! 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
771 %! 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
772