annotate scripts/image/imagesc.m @ 17692:38cf56b77274

Overhaul image, imagesc to use newplot and support low-level invocation form. * scripts/image/image.m: New variable do_new indicates high-level calling form. For high-level invocation, call newplot before __img__. Correct linearity check if vectors are reversed (high-to-low values). Only apply image properties to axes if doing a high-level invocation. * scripts/image/imagesc.m: New variable do_new indicates high-level calling form. Delete subfunction __imagesc__ and incorporate minimal amount of code into imagesc. Only apply climits for high-level invocation.
author Rik <rik@octave.org>
date Fri, 18 Oct 2013 16:27:44 -0700
parents dd8db3f1c1da
children d63878346099
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: 14001
diff changeset
1 ## Copyright (C) 1994-2012 John W. Eaton
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
2 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
3 ## This file is part of Octave.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
4 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
6 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6368
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6368
diff changeset
8 ## your option) any later version.
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
9 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
13 ## General Public License for more details.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
14 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2312
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6368
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6368
diff changeset
17 ## <http://www.gnu.org/licenses/>.
1024
56520a75b5b3 [project @ 1995-01-11 20:30:04 by jwe]
jwe
parents: 904
diff changeset
18
3381
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3373
diff changeset
19 ## -*- texinfo -*-
15683
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
20 ## @deftypefn {Function File} {} imagesc (@var{img})
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
21 ## @deftypefnx {Function File} {} imagesc (@var{x}, @var{y}, @var{img})
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
22 ## @deftypefnx {Function File} {} imagesc (@dots{}, @var{climits})
17689
dd8db3f1c1da doc: Add information about High-Level/Low-Level calling forms for image, imagesc.
Rik <rik@octave.org>
parents: 17281
diff changeset
23 ## @deftypefnx {Function File} {} imagesc (@dots{}, "@var{prop}", @var{val}, @dots{})
dd8db3f1c1da doc: Add information about High-Level/Low-Level calling forms for image, imagesc.
Rik <rik@octave.org>
parents: 17281
diff changeset
24 ## @deftypefnx {Function File} {} imagesc ("@var{prop1}", @var{val1}, @dots{})
17125
b5d6314314fc Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents: 15683
diff changeset
25 ## @deftypefnx {Function File} {} imagesc (@var{hax}, @dots{})
7650
eb7bdde776f2 Texinfo fixes
John W. Eaton <jwe@octave.org>
parents: 7471
diff changeset
26 ## @deftypefnx {Function File} {@var{h} =} imagesc (@dots{})
15683
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
27 ## Display a scaled version of the matrix @var{img} as a color image. The
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7017
diff changeset
28 ## colormap is scaled so that the entries of the matrix occupy the entire
15683
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
29 ## colormap. If @code{@var{climits} = [@var{lo}, @var{hi}]} is given, then that
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17125
diff changeset
30 ## range is set to the @qcode{"clim"} of the current axes.
3651
c2305b99fbd7 [project @ 2000-03-31 07:12:29 by jwe]
jwe
parents: 3457
diff changeset
31 ##
c2305b99fbd7 [project @ 2000-03-31 07:12:29 by jwe]
jwe
parents: 3457
diff changeset
32 ## The axis values corresponding to the matrix elements are specified in
4403
f52b3f1a9399 [project @ 2003-05-01 19:28:11 by jwe]
jwe
parents: 3882
diff changeset
33 ## @var{x} and @var{y}, either as pairs giving the minimum and maximum
f52b3f1a9399 [project @ 2003-05-01 19:28:11 by jwe]
jwe
parents: 3882
diff changeset
34 ## values for the respective axes, or as values for each row and column
15683
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
35 ## of the matrix @var{img}.
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7017
diff changeset
36 ##
14001
5f0bb45e615c doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
37 ## The optional return value @var{h} is a graphics handle to the image.
17689
dd8db3f1c1da doc: Add information about High-Level/Low-Level calling forms for image, imagesc.
Rik <rik@octave.org>
parents: 17281
diff changeset
38 ##
dd8db3f1c1da doc: Add information about High-Level/Low-Level calling forms for image, imagesc.
Rik <rik@octave.org>
parents: 17281
diff changeset
39 ## Calling Forms: The @code{imagesc} function can be called in two forms:
dd8db3f1c1da doc: Add information about High-Level/Low-Level calling forms for image, imagesc.
Rik <rik@octave.org>
parents: 17281
diff changeset
40 ## High-Level and Low-Level. When invoked with normal options, the High-Level
dd8db3f1c1da doc: Add information about High-Level/Low-Level calling forms for image, imagesc.
Rik <rik@octave.org>
parents: 17281
diff changeset
41 ## form is used which first calls @code{newplot} to prepare the graphic figure
dd8db3f1c1da doc: Add information about High-Level/Low-Level calling forms for image, imagesc.
Rik <rik@octave.org>
parents: 17281
diff changeset
42 ## and axes. When the only inputs to @code{image} are property/value pairs
dd8db3f1c1da doc: Add information about High-Level/Low-Level calling forms for image, imagesc.
Rik <rik@octave.org>
parents: 17281
diff changeset
43 ## the Low-Level form is used which creates a new instance of an image object
dd8db3f1c1da doc: Add information about High-Level/Low-Level calling forms for image, imagesc.
Rik <rik@octave.org>
parents: 17281
diff changeset
44 ## and inserts it in the current axes.
dd8db3f1c1da doc: Add information about High-Level/Low-Level calling forms for image, imagesc.
Rik <rik@octave.org>
parents: 17281
diff changeset
45 ##
8286
6f2d95255911 fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7650
diff changeset
46 ## @seealso{image, imshow, caxis}
3373
36405da8e173 [project @ 1999-11-23 20:54:17 by jwe]
jwe
parents: 3225
diff changeset
47 ## @end deftypefn
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
48
3202
44d82b369c78 [project @ 1998-10-29 20:27:57 by jwe]
jwe
parents: 2847
diff changeset
49 ## Author: Tony Richardson <arichard@stark.cc.oh.us>
2312
204cc7db6f4a [project @ 1996-07-11 21:20:36 by jwe]
jwe
parents: 2311
diff changeset
50 ## Created: July 1994
204cc7db6f4a [project @ 1996-07-11 21:20:36 by jwe]
jwe
parents: 2311
diff changeset
51 ## Adapted-By: jwe
904
3470f1e25a79 [project @ 1994-11-09 21:22:15 by jwe]
jwe
parents: 559
diff changeset
52
15683
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
53 function h = imagesc (varargin)
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7017
diff changeset
54
17692
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
55 [hax, varargin, nargin] = __plt_get_axis_arg__ ("imagesc", varargin{:});
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
56
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
57 chararg = find (cellfun ("isclass", varargin, "char"), 1, "first");
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
58
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
59 do_new = true;
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
60 if (nargin == 0)
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7017
diff changeset
61 print_usage ();
17692
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
62 elseif (chararg == 1)
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
63 ## Low-Level syntax
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
64 do_new = false;
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
65 img = x = y = climits = [];
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
66 elseif (nargin == 1 || chararg == 2)
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
67 img = varargin{1};
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
68 x = y = climits = [];
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
69 elseif (nargin == 2 || chararg == 3)
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
70 img = varargin{1};
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
71 climits = varargin{2};
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
72 x = y = [];
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
73 elseif (nargin == 3 || chararg == 4)
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
74 x = varargin{1};
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
75 y = varargin{2};
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
76 img = varargin{3};
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
77 climits = [];
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
78 elseif (nargin == 4 || chararg == 5)
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
79 x = varargin{1};
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
80 y = varargin{2};
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
81 img = varargin{3};
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
82 climits = varargin{4};
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
83 endif
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
84
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
85 oldfig = [];
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
86 if (! isempty (hax))
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
87 oldfig = get (0, "currentfigure");
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
88 endif
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
89 unwind_protect
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
90 if (do_new)
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
91 hax = newplot (hax);
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
92 elseif (isempty (hax))
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
93 hax = gca ();
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7017
diff changeset
94 endif
17692
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
95
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
96 if (do_new)
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
97 htmp = image (x, y, img, "cdatamapping", "scaled", varargin{chararg:end});
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
98 else
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
99 htmp = image ("cdatamapping", "scaled", varargin{:});
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
100 endif
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
101
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
102 if (do_new && ! ishold (hax))
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
103 ## use given climits or guess them from the matrix
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
104 if (numel (climits) == 2 && climits(1) <= climits(2))
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
105 set (hax, "clim", climits);
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
106 elseif (! isempty (climits))
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
107 error ("imagesc: CLIMITS must be in form [lo, hi]");
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
108 endif
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
109 endif
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
110 unwind_protect_cleanup
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
111 if (! isempty (oldfig))
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
112 set (0, "currentfigure", oldfig);
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
113 endif
38cf56b77274 Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents: 17689
diff changeset
114 end_unwind_protect
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7017
diff changeset
115
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7017
diff changeset
116 if (nargout > 0)
15683
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
117 h = htmp;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
118 endif
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
119
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
120 endfunction
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
121
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
122
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
123 %!demo
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
124 %! clf;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
125 %! colormap ("default");
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
126 %! img = 1 ./ hilb (11);
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
127 %! x = y = -5:5;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
128 %! subplot (2,2,1);
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
129 %! h = imagesc (x, y, img);
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
130 %! ylabel ("limits = [-5.5, 5.5]");
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
131 %! title ("imagesc (x, y, img)");
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
132 %! subplot (2,2,2);
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
133 %! h = imagesc (-x, y, img);
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
134 %! title ("imagesc (-x, y, img)");
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
135 %! subplot (2,2,3);
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
136 %! h = imagesc (x, -y, img);
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
137 %! title ("imagesc (x, -y, img)");
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
138 %! ylabel ("limits = [-5.5, 5.5]");
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
139 %! subplot (2,2,4);
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
140 %! h = imagesc (-x, -y, img);
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
141 %! title ("imagesc (-x, -y, img)");
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
142
15683
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
143 %!demo
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
144 %! clf;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
145 %! colormap ("default");
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
146 %! g = 0.1:0.1:10;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
147 %! h = g'*g;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
148 %! imagesc (g, g, sin (h));
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
149 %! hold on;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
150 %! imagesc (g, g+12, cos (h/2));
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
151 %! axis ([0 10 0 22]);
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
152 %! hold off;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
153 %! title ("two consecutive images");
6368
ec2a523713b5 [project @ 2007-02-28 22:07:24 by jwe]
jwe
parents: 6046
diff changeset
154
15683
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
155 %!demo
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
156 %! clf;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
157 %! colormap ("default");
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
158 %! g = 0.1:0.1:10;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
159 %! h = g'*g;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
160 %! imagesc (g, g, sin (h));
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
161 %! hold all;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
162 %! plot (g, 11.0 * ones (size (g)));
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
163 %! imagesc (g, g+12, cos (h/2));
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
164 %! axis ([0 10 0 22]);
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
165 %! hold off;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
166 %! title ("image, line, image");
559
4e826edfbc56 [project @ 1994-07-25 22:18:28 by jwe]
jwe
parents:
diff changeset
167
15683
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
168 %!demo
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
169 %! clf;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
170 %! colormap ("default");
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
171 %! g = 0.1:0.1:10;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
172 %! h = g'*g;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
173 %! plot (g, 10.5 * ones (size (g)));
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
174 %! hold all;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
175 %! imagesc (g, g, sin (h));
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
176 %! plot (g, 11.0 * ones (size (g)));
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
177 %! imagesc (g, g+12, cos (h/2));
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
178 %! plot (g, 11.5 * ones (size (g)));
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
179 %! axis ([0 10 0 22]);
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
180 %! hold off;
806ea52af230 Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents: 14359
diff changeset
181 %! title ("line, image, line, image, line");
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents: 7017
diff changeset
182