Mercurial > hg > octave-lyh
annotate scripts/plot/caxis.m @ 14359:7277fe922e99
doc: Use Octave preference for double quote in docstrings in scripts/
* interp1.m, interp2.m, interp3.m, interpn.m, profexplore.m, profile.m,
profshow.m, quadgk.m, lookfor.m, imagesc.m, bzip2.m, gzip.m, parseparams.m,
pkg.m, ancestor.m, caxis.m, ezmesh.m, ezmeshc.m, ezsurf.m, ezsurfc.m, hidden.m,
hold.m, patch.m, pie.m, pie3.m, quiver.m, quiver3.m, scatter3.m,
uicontextmenu.m, uicontrol.m, uipanel.m, uipushtool.m, uitoggletool.m,
uitoolbar.m, xlim.m, ylim.m, zlim.m, ismember.m, setxor.m, filter2.m, bicg.m,
demo.m, example.m, fail.m, test.m: Use Octave preference for double quote in
docstrings in scripts/ directory.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Mon, 13 Feb 2012 07:38:23 -0800 |
parents | 72c96de7a403 |
children | 19c3b5bf5c8e |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11589
diff
changeset
|
1 ## Copyright (C) 2007-2012 David Bateman |
7189 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
19 ## -*- texinfo -*- | |
10793
be55736a0783
Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents:
9040
diff
changeset
|
20 ## @deftypefn {Function File} {} caxis (@var{limits}) |
7189 | 21 ## @deftypefnx {Function File} {} caxis (@var{h}, @dots{}) |
22 ## Set color axis limits for plots. | |
23 ## | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11563
diff
changeset
|
24 ## The argument @var{limits} should be a 2-element vector specifying the |
7189 | 25 ## lower and upper limits to assign to the first and last value in the |
9040
dbd0c77e575e
Cleanup documentation file plot.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
26 ## colormap. Values outside this range are clamped to the first and last |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11563
diff
changeset
|
27 ## colormap entries. |
7189 | 28 ## |
14359
7277fe922e99
doc: Use Octave preference for double quote in docstrings in scripts/
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
29 ## If @var{limits} is "auto", then automatic colormap scaling is applied, |
7277fe922e99
doc: Use Octave preference for double quote in docstrings in scripts/
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
30 ## whereas if @var{limits} is "manual" the colormap scaling is set to manual. |
7189 | 31 ## |
32 ## Called without any arguments to current color axis limits are returned. | |
33 ## | |
34 ## If an axes handle is passed as the first argument, then operate on | |
35 ## this axes rather than the current axes. | |
36 ## @end deftypefn | |
37 | |
38 function varargout = caxis (varargin) | |
39 | |
7215 | 40 [h, varargin, nargin] = __plt_get_axis_arg__ ("caxis", varargin{:}); |
7216 | 41 |
7215 | 42 oldh = gca (); |
43 unwind_protect | |
44 axes (h); | |
7189 | 45 varargout = cell (max (nargin == 0, nargout), 1); |
46 if (isempty (varargout)) | |
7215 | 47 __caxis__ (h, varargin{:}); |
7189 | 48 else |
7215 | 49 [varargout{:}] = __caxis__ (h, varargin{:}); |
7189 | 50 endif |
7215 | 51 unwind_protect_cleanup |
52 axes (oldh); | |
53 end_unwind_protect | |
7189 | 54 |
55 endfunction | |
56 | |
57 function [cmin, cmax] = __caxis__ (ca, ax, varargin) | |
58 | |
59 if (nargin == 1) | |
60 cmin = get (ca, "clim"); | |
61 if (nargout > 1) | |
62 cmax = cmin(2); | |
63 cmin = cmin(1); | |
64 endif | |
65 elseif (ischar (ax)) | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7216
diff
changeset
|
66 if (strcmpi (ax, "auto")) |
7189 | 67 set (ca, "climmode", "auto"); |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7216
diff
changeset
|
68 elseif (strcmpi (ax, "manual")) |
7189 | 69 set (ca, "climmode", "manual"); |
70 endif | |
71 elseif (isvector (ax)) | |
72 len = length (ax); | |
73 | |
74 if (len != 2) | |
75 error ("caxis: expecting vector with 2 elements"); | |
76 endif | |
77 | |
78 set (ca, "clim", [ax(1), ax(2)]); | |
79 else | |
80 error ("caxis: expecting no args, a string or a 2 element vector"); | |
81 endif | |
82 | |
83 if (nargin > 2) | |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
84 __caxis__ (ca, varargin{:})'; |
7189 | 85 endif |
86 | |
87 endfunction | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11563
diff
changeset
|
88 |