Mercurial > octave
annotate scripts/plot/appearance/yticks.m @ 30564:796f54d4ddbf stable
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2021.
In all .txi and .texi files except gpl.txi and gpl.texi in the
doc/liboctave and doc/interpreter directories, change the copyright
to "Octave Project Developers", the same as used for other source
files. Update copyright notices for 2022 (not done since 2019). For
gpl.txi and gpl.texi, change the copyright notice to be "Free Software
Foundation, Inc." and leave the date at 2007 only because this file
only contains the text of the GPL, not anything created by the Octave
Project Developers.
Add Paul Thomas to contributors.in.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 28 Dec 2021 18:22:40 -0500 |
parents | 7854d5752dd2 |
children | 5d3faba0342e |
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 ## |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
3 ## Copyright (C) 2017-2022 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/>. |
24050
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
7 ## |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
8 ## This file is part of Octave. |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
9 ## |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24507
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
24050
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
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:
24507
diff
changeset
|
12 ## the Free Software Foundation, either version 3 of the License, or |
24050
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
13 ## (at your option) any later version. |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
14 ## |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
15 ## Octave is distributed in the hope that it will be useful, but |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
18 ## GNU General Public License for more details. |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
19 ## |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
20 ## You should have received a copy of the GNU General Public License |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
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:
24507
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 ######################################################################## |
24050
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
25 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
26 ## -*- texinfo -*- |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
27 ## @deftypefn {} {@var{tickval} =} yticks |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
28 ## @deftypefnx {} {@var{mode} =} yticks ("mode") |
24507
dc25a0dc7800
Correct a host of small formatting issues with Texinfo manual (bug #52774)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24208
diff
changeset
|
29 ## @deftypefnx {} {} yticks (@var{tickval}) |
dc25a0dc7800
Correct a host of small formatting issues with Texinfo manual (bug #52774)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24208
diff
changeset
|
30 ## @deftypefnx {} {} yticks ("auto") |
dc25a0dc7800
Correct a host of small formatting issues with Texinfo manual (bug #52774)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24208
diff
changeset
|
31 ## @deftypefnx {} {} yticks ("manual") |
24050
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
32 ## @deftypefnx {} {@dots{} =} yticks (@var{hax}, @dots{}) |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
33 ## Query or set the tick values on the y-axis of the current axis. |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
34 ## |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
35 ## When called without an argument, return the current tick locations as |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
36 ## specified in the @qcode{"ytick"} axes property. These locations can be |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
37 ## changed by calling @code{yticks} with a vector of tick values. Note: |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
38 ## ascending order is not required. |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
39 ## |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
40 ## When called with argument @qcode{"mode"}, @code{yticks} returns the current |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
41 ## value of the axes property @qcode{"ytickmode"}. This property can be |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
42 ## changed by calling @code{yticks} with either @qcode{"auto"} (algorithm |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
43 ## determines tick positions) or @qcode{"manual"} (tick values remain fixed |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
44 ## regardless of axes resizing or rotation). Note: Specifying ytick values |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
45 ## will also set the property @qcode{"ytickmode"} to @qcode{"manual"}. |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
46 ## |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
47 ## If the first argument @var{hax} is an axes handle, then operate on |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
48 ## this axis rather than the current axes returned by @code{gca}. |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
49 ## |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
50 ## Requesting a return value when calling @code{yticks} to set a property value |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
51 ## will result in an error. |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
52 ## |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
53 ## @seealso{yticklabels, xticks, zticks, rticks, thetaticks, get, set} |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
54 ## @end deftypefn |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
55 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
56 function retval = yticks (varargin) |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
57 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
58 hax = []; |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
59 switch (nargin) |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
60 case 0 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
61 retval = get (gca , "ytick"); # will error if no ytick exists. |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
62 return; |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
63 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
64 case 1 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
65 if (isaxes (varargin{1})) |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
66 retval = get (varargin{1}, "ytick"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
67 return; |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
68 else |
24208
eec262017c6a
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
24050
diff
changeset
|
69 arg = varargin{1}; |
24050
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
70 endif |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
71 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
72 case 2 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
73 if (! isaxes (varargin{1})) |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
74 error ("yticks: HAX must be a handle to an axes object"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
75 endif |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
76 hax = varargin{1}; |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
77 arg = varargin{2}; |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
78 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
79 otherwise |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
80 print_usage (); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
81 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
82 endswitch |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
83 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
84 if (isempty (hax)) |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
85 hax = gca (); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
86 endif |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
87 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
88 if (isnumeric (arg)) |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
89 if (nargout > 0) |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
90 error ("yticks: too many output arguments requested"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
91 else |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
92 ## NOTE: Matlab errors if tick points are not in ascending order. Octave |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
93 ## permits out of order tick points, so error is not produced. |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
94 set (hax, "ytick", arg); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
95 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
96 endif |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
97 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
98 elseif (ischar (arg)) |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
99 arg = tolower (arg); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
100 switch (arg) |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
101 case "mode" |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
102 retval = get (hax, "ytickmode"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
103 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
104 case {"auto", "manual"} |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
105 if (nargout > 0) |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
106 error ("yticks: too many output arguments requested for arg: %s", |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
107 arg); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
108 endif |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
109 set (hax, "ytickmode", arg); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
110 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
111 otherwise |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
112 error ("yticks: invalid option: %s", arg); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
113 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
114 endswitch |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
115 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
116 else |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
117 print_usage (); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
118 endif |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
119 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
120 endfunction |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
121 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
122 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
123 %!test |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
124 %! hf = figure ("visible", "off"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
125 %! unwind_protect |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
126 %! set (gca, "ytickmode", "auto"); |
28892
3cac3ceb9629
maint: Use coding style with parentheses after function name to distinguish from a variable.
Rik <rik@octave.org>
parents:
27985
diff
changeset
|
127 %! hax = gca (); |
24050
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
128 %! vals1 = yticks; |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
129 %! assert (yticks (hax), vals1); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
130 %! mode1 = yticks ("mode"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
131 %! assert (yticks (hax, "mode"), mode1); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
132 %! yticks (hax, "manual"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
133 %! assert (yticks (hax, "mode"), "manual"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
134 %! yticks (hax, "auto"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
135 %! assert (yticks (hax, "mode"), "auto"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
136 %! yticks (hax, [1 2 3 4]); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
137 %! assert (yticks (hax), [1 2 3 4]); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
138 %! assert (yticks (hax, "mode"), "manual"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
139 %! unwind_protect_cleanup |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
140 %! close (hf); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
141 %! end_unwind_protect |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
142 |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
143 ## Test input validation |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
144 %!error yticks (1,2,3) |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
145 %!test |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
146 %! hf = figure ("visible", "off"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
147 %! unwind_protect |
28892
3cac3ceb9629
maint: Use coding style with parentheses after function name to distinguish from a variable.
Rik <rik@octave.org>
parents:
27985
diff
changeset
|
148 %! hax = gca (); |
24050
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
149 %! fail ("yticks (-1, [0 1])", "HAX must be a handle to an axes"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
150 %! fail ("tmp = yticks (hax, [0 1])", "too many output arguments"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
151 %! fail ("tmp = yticks (hax, 'auto')", "too many .* for arg: auto"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
152 %! fail ("tmp = yticks (hax, 'foo')", "invalid option: foo"); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
153 %! unwind_protect_cleanup |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
154 %! close (hf); |
a03bb64031da
Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff
changeset
|
155 %! end_unwind_protect |