Mercurial > octave
annotate scripts/image/imagesc.m @ 27985:9f9ac219896d
maint: Remove remaining "Author:" instances from code base.
* __ftp__.cc, load-save.cc, urlwrite.cc, xnorm.cc, xnorm.h, cconv2.f,
cdotc3.f, cmatm3.f, csconv2.f, dconv2.f, ddot3.f, dmatm3.f, sconv2.f, sdot3.f,
smatm3.f, zconv2.f, zdconv2.f, zdotc3.f, zmatm3.f, crsf2csf.f, zrsf2csf.f,
oct-norm.cc, oct-norm.h, lin2mu.m, mu2lin.m, bincoeff.m, blkdiag.m, deal.m,
gradient.m, interpft.m, nextpow2.m, postpad.m, prepad.m, repmat.m, shift.m,
xor.m, griddata.m, rotx.m, roty.m, rotz.m, voronoin.m, getappdata.m,
isappdata.m, rmappdata.m, setappdata.m, colormap.m, gray.m, gray2ind.m,
im2double.m, image.m, imagesc.m, imread.m, imshow.m, ind2gray.m, ind2rgb.m,
ocean.m, __imread__.m, rgb2ind.m, javachk.m, ClassHelper.java, usejava.m,
findstr.m, commutation_matrix.m, cross.m, gls.m, housh.m, isdefinite.m,
ishermitian.m, issymmetric.m, logm.m, null.m, ols.m, orth.m, qzhess.m, rref.m,
dos.m, nargoutchk.m, orderfields.m, parseparams.m, __w2mpth__.m, unix.m,
untar.m, unzip.m, expand_rel_paths.m, make_rel_paths.m, daspect.m, orient.m,
pbaspect.m, rticks.m, thetaticks.m, xticklabels.m, xticks.m, yticklabels.m,
yticks.m, zticklabels.m, zticks.m, comet.m, contourf.m, plot3.m, cla.m,
copyobj.m, findfigs.m, hdl2struct.m, linkaxes.m, __ghostscript__.m,
__gnuplot_get_var__.m, __gnuplot_has_feature__.m, __gnuplot_has_terminal__.m,
__gnuplot_open_stream__.m, __gnuplot_print__.m, struct2hdl.m, subplot.m,
compan.m, conv.m, deconv.m, mpoles.m, poly.m, polyder.m, polyfit.m, polyint.m,
polyout.m, polyreduce.m, polyval.m, polyvalm.m, residue.m, roots.m, ismember.m,
__parse_movargs__.m, detrend.m, fftconv.m, fftfilt.m, fftshift.m, filter2.m,
movfun.m, movslice.m, ichol.m, pcg.m, beta.m, ellipke.m, lcm.m, nchoosek.m,
pow2.m, primes.m, pascal.m, rosser.m, wilkinson.m, corr.m, kurtosis.m,
skewness.m, base2dec.m, bin2dec.m, blanks.m, deblank.m, dec2base.m, dec2bin.m,
dec2hex.m, hex2dec.m, index.m, rindex.m, strjoin.m, substr.m, untabify.m,
calendar.m, datestr.m, eomday.m, now.m, weekday.m:
Remove remaining "Author:" instances from code base.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 21 Jan 2020 14:35:03 -0800 |
parents | 7f1cec12c240 |
children | 9342688e86b4 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 ######################################################################## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 ## |
27919
1891570abac8
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27918
diff
changeset
|
3 ## Copyright (C) 1994-2020 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
4 ## |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 ## See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 ## distribution or <https://octave.org/copyright/>. |
2313 | 7 ## |
8 ## This file is part of Octave. | |
9 ## | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24057
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
2313 | 11 ## under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24057
diff
changeset
|
12 ## the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22369
diff
changeset
|
13 ## (at your option) any later version. |
2313 | 14 ## |
15 ## Octave is distributed in the hope that it will be useful, but | |
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22369
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22369
diff
changeset
|
18 ## GNU General Public License for more details. |
2313 | 19 ## |
20 ## You should have received a copy of the GNU General Public License | |
7016 | 21 ## along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24057
diff
changeset
|
22 ## <https://www.gnu.org/licenses/>. |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 ## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 ######################################################################## |
1024 | 25 |
3381 | 26 ## -*- texinfo -*- |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20158
diff
changeset
|
27 ## @deftypefn {} {} imagesc (@var{img}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20158
diff
changeset
|
28 ## @deftypefnx {} {} imagesc (@var{x}, @var{y}, @var{img}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20158
diff
changeset
|
29 ## @deftypefnx {} {} imagesc (@dots{}, @var{climits}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20158
diff
changeset
|
30 ## @deftypefnx {} {} imagesc (@dots{}, "@var{prop}", @var{val}, @dots{}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20158
diff
changeset
|
31 ## @deftypefnx {} {} imagesc ("@var{prop1}", @var{val1}, @dots{}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20158
diff
changeset
|
32 ## @deftypefnx {} {} imagesc (@var{hax}, @dots{}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20158
diff
changeset
|
33 ## @deftypefnx {} {@var{h} =} imagesc (@dots{}) |
20158
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
34 ## Display a scaled version of the matrix @var{img} as a color image. |
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
35 ## |
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
36 ## The colormap is scaled so that the entries of the matrix occupy the entire |
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
37 ## colormap. If @code{@var{climits} = [@var{lo}, @var{hi}]} is given, then |
7503499a252b
doc: Update docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
38 ## that range is set to the @qcode{"clim"} of the current axes. |
3651 | 39 ## |
25856
9578af67a0d4
Document that image x/ydata indicate the centers of corner pixels (bug #54610).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
40 ## @var{x} and @var{y} are optional 2-element vectors, @w{@code{[min, max]}}, |
9578af67a0d4
Document that image x/ydata indicate the centers of corner pixels (bug #54610).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
41 ## which specify the coordinates of the centers of the corner pixels. |
9578af67a0d4
Document that image x/ydata indicate the centers of corner pixels (bug #54610).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
42 ## If a range is specified as @w{@code{[max, min]}} then the image will be |
9578af67a0d4
Document that image x/ydata indicate the centers of corner pixels (bug #54610).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
43 ## reversed along that axis. For convenience, @var{x} and @var{y} may be |
9578af67a0d4
Document that image x/ydata indicate the centers of corner pixels (bug #54610).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
44 ## specified as N-element vectors matching the length of the data in @var{img}. |
25980
221c039aa415
Fix rendering of images with permuted x/ydata (bug #49756).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25856
diff
changeset
|
45 ## However, only the first and last elements will be used to determine |
221c039aa415
Fix rendering of images with permuted x/ydata (bug #49756).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25856
diff
changeset
|
46 ## the image limits. |
7189 | 47 ## |
14001
5f0bb45e615c
doc: Update documentation for functions returning a graphics handle h (Bug #34761)
Rik <octave@nomad.inbox5.com>
parents:
11589
diff
changeset
|
48 ## 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
|
49 ## |
dd8db3f1c1da
doc: Add information about High-Level/Low-Level calling forms for image, imagesc.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
50 ## 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
|
51 ## 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
|
52 ## 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
|
53 ## 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
|
54 ## 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
|
55 ## 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
|
56 ## |
8286
6f2d95255911
fix @seealso references to point to existing anchors
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
7650
diff
changeset
|
57 ## @seealso{image, imshow, caxis} |
3373 | 58 ## @end deftypefn |
559 | 59 |
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
|
60 function h = imagesc (varargin) |
7189 | 61 |
17692
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
62 [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
|
63 |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
64 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
|
65 |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
66 do_new = true; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
67 if (nargin == 0) |
7189 | 68 print_usage (); |
17692
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
69 elseif (chararg == 1) |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
70 ## Low-Level syntax |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
71 do_new = false; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
72 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
|
73 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
|
74 img = varargin{1}; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
75 x = y = climits = []; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
76 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
|
77 img = varargin{1}; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
78 climits = varargin{2}; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
79 x = y = []; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
80 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
|
81 x = varargin{1}; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
82 y = varargin{2}; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
83 img = varargin{3}; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
84 climits = []; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
85 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
|
86 x = varargin{1}; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
87 y = varargin{2}; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
88 img = varargin{3}; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
89 climits = varargin{4}; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
90 endif |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
91 |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
92 oldfig = []; |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
93 if (! isempty (hax)) |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
94 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
|
95 endif |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
96 unwind_protect |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
97 if (do_new) |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
98 hax = newplot (hax); |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
99 elseif (isempty (hax)) |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
100 hax = gca (); |
7189 | 101 endif |
17692
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
102 |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
103 if (do_new) |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
104 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
|
105 else |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
106 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
|
107 endif |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
108 |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
109 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
|
110 ## 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
|
111 if (numel (climits) == 2 && climits(1) <= climits(2)) |
24056
ae35d50d9756
Ensure numeric values are passed for the axes "clim" property (bug #52053).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
23219
diff
changeset
|
112 set (hax, "clim", double (climits)); |
17692
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
113 elseif (! isempty (climits)) |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
114 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
|
115 endif |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
116 endif |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
117 unwind_protect_cleanup |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
118 if (! isempty (oldfig)) |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
119 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
|
120 endif |
38cf56b77274
Overhaul image, imagesc to use newplot and support low-level invocation form.
Rik <rik@octave.org>
parents:
17689
diff
changeset
|
121 end_unwind_protect |
7189 | 122 |
123 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
|
124 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
|
125 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
|
126 |
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 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
|
128 |
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 |
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 %!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
|
131 %! 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
|
132 %! 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
|
133 %! 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
|
134 %! 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
|
135 %! 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
|
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 %! 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
|
138 %! 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
|
139 %! 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
|
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)"); |
806ea52af230
Overhaul m-files in image directory to provide better support for images stored as integers.
Rik <rik@octave.org>
parents:
14359
diff
changeset
|
142 %! 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
|
143 %! 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
|
144 %! 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
|
145 %! 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
|
146 %! 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
|
147 %! 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
|
148 %! title ("imagesc (-x, -y, img)"); |
559 | 149 |
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
|
150 %!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
|
151 %! 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
|
152 %! 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
|
153 %! 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
|
154 %! 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
|
155 %! 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
|
156 %! 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
|
157 %! 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
|
158 %! 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
|
159 %! hold off; |
22312
533c3c4059a3
Add titles to more of the graphic demos.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
160 %! title ("two consecutive images w/hold()"); |
6368 | 161 |
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
|
162 %!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
|
163 %! 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
|
164 %! 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
|
165 %! 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
|
166 %! 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
|
167 %! imagesc (g, g, sin (h)); |
22069
9121d6584f6a
Overhaul graphics implementation of hold() (bug #43559).
Rik <rik@octave.org>
parents:
20852
diff
changeset
|
168 %! hold on; |
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
|
169 %! 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
|
170 %! 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
|
171 %! 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
|
172 %! hold off; |
22312
533c3c4059a3
Add titles to more of the graphic demos.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
173 %! title ("image, line, image w/hold()"); |
559 | 174 |
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
|
175 %!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
|
176 %! 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
|
177 %! 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
|
178 %! 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
|
179 %! 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
|
180 %! plot (g, 10.5 * ones (size (g))); |
22069
9121d6584f6a
Overhaul graphics implementation of hold() (bug #43559).
Rik <rik@octave.org>
parents:
20852
diff
changeset
|
181 %! hold on; |
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
|
182 %! 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
|
183 %! 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
|
184 %! 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
|
185 %! 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
|
186 %! 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
|
187 %! hold off; |
22312
533c3c4059a3
Add titles to more of the graphic demos.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
188 %! title ("line, image, line, image, line w/hold()"); |
7189 | 189 |
22369
17c9cc85842e
Fix display of scaled images in OpenGL toolkits (bug #48879).
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
190 %!demo # bug #48879 |
17c9cc85842e
Fix display of scaled images in OpenGL toolkits (bug #48879).
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
191 %! clf; |
17c9cc85842e
Fix display of scaled images in OpenGL toolkits (bug #48879).
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
192 %! img = reshape (1:100, 10, 10); |
17c9cc85842e
Fix display of scaled images in OpenGL toolkits (bug #48879).
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
193 %! imagesc (img); |
17c9cc85842e
Fix display of scaled images in OpenGL toolkits (bug #48879).
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
194 %! colormap (prism (10)); |
17c9cc85842e
Fix display of scaled images in OpenGL toolkits (bug #48879).
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
195 %! title ("10 vertical color bars"); |