annotate scripts/plot/appearance/rticks.m @ 29359:7854d5752dd2

maint: merge stable to default.
author John W. Eaton <jwe@octave.org>
date Wed, 10 Feb 2021 10:10:40 -0500
parents 3cac3ceb9629 0a5b15007766
children 796f54d4ddbf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 ##
29358
0a5b15007766 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27985
diff changeset
3 ## Copyright (C) 2017-2021 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} =} rticks
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
28 ## @deftypefnx {} {} rticks (@var{tickval})
24050
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
29 ## @deftypefnx {} {@dots{} =} rticks (@var{hax}, @dots{})
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
30 ## Query or set the tick values on the r-axis of the current axis.
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
31 ##
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
32 ## When called without argument, return the current tick locations as specified
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
33 ## in the @qcode{"rtick"} axes property. These locations can be changed by
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
34 ## calling @code{rticks} with a vector of tick values. Note: ascending order
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
35 ## is not required.
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
36 ##
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
37 ## 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
38 ## 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
39 ##
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
40 ## Requesting a return value when calling @code{rticks} to set a property value
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
41 ## will result in an error.
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
42 ##
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
43 ## NOTE: Octave does not currently implement polaraxes objects. It is
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
44 ## therefore not possible to query or set a @qcode{"mode"} for the
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
45 ## @qcode{"rtick"} property as can be done with the equivalent functions for
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
46 ## @var{x}, @var{y}, and @var{z} axes.
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
47 ##
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
48 ## @seealso{thetaticks, xticks, yticks, zticks, polar, get, set}
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
49 ## @end deftypefn
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
50
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
51 function retval = rticks (varargin)
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 hax = [];
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
54 switch (nargin)
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
55 case 0
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
56 retval = get (gca (), "rtick"); # will error if no rtick exists.
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
57 return;
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
58
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
59 case 1
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
60 if (isaxes (varargin{1}))
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
61 retval = get (varargin{1}, "rtick");
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 else
24208
eec262017c6a maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 24050
diff changeset
64 arg = varargin{1};
24050
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
65 endif
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
66
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
67 case 2
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
68 if (! isaxes (varargin{1}))
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
69 error ("rticks: 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
70 endif
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
71 hax = varargin{1};
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
72 arg = varargin{2};
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
73
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
74 otherwise
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
75 print_usage ();
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
76
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
77 endswitch
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 if (isempty (hax))
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
80 hax = gca ();
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
81 endif
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
82
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
83 if (isnumeric (arg))
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
84 if (nargout > 0)
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
85 error ("rticks: too many output arguments requested");
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 ## 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
88 ## permits out of order tick points, so no error is produced.
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
89 set (hax, "rtick", arg);
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
90
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
91 elseif (ischar (arg))
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
92 error ("rticks: MODE is not yet implemented for the rtick property");
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
93
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
94 ## FIXME: Enable mode args if/when they are available in polar/polarplot
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
95 ## arg = tolower (arg);
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
96 ## switch (arg)
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
97 ## case "mode"
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
98 ## retval = get (hax, "rtickmode");
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
99 ##
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
100 ## case {"auto", "manual"}
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
101 ## if (nargout > 0)
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
102 ## error (["rticks: " ...
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
103 ## "too many output arguments requested for arg: ", arg]);
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
104 ## endif
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
105 ## set (hax, "rtickmode", arg);
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
106 ##
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
107 ## otherwise
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
108 ## error ("rticks: invalid option: %s", arg);
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
109 ##
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
110 ## endswitch
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
111
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
112 else
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
113 print_usage ();
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
114 endif
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 endfunction
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
117
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
118
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
119 %!test
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
120 %! hf = figure ("visible", "off");
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
121 %! unwind_protect
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
122 %! polar (linspace (0, pi, 20), rand (20,1));
28892
3cac3ceb9629 maint: Use coding style with parentheses after function name to distinguish from a variable.
Rik <rik@octave.org>
parents: 27985
diff changeset
123 %! hax = gca ();
24050
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
124 %! ticks = rticks;
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
125 %! assert (rticks (hax), ticks);
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
126 %! rticks (hax, [0 0.25 0.75 1 2]);
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
127 %! assert (rticks (hax), [0 0.25 0.75 1 2]);
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
128 %! unwind_protect_cleanup
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
129 %! close (hf);
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
130 %! end_unwind_protect
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
131
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
132 ## Test input validation
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
133 %!error rticks (1,2,3)
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
134 %!test
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
135 %! hf = figure ("visible", "off");
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
136 %! unwind_protect
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
137 %! polar (linspace (0, pi, 20), 1:20);
28892
3cac3ceb9629 maint: Use coding style with parentheses after function name to distinguish from a variable.
Rik <rik@octave.org>
parents: 27985
diff changeset
138 %! hax = gca ();
24050
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
139 %! fail ("rticks (-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
140 %! fail ("tmp = rticks (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
141 %! fail ("tmp = rticks (hax, 'mode')", "MODE is not yet implemented");
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
142 %! unwind_protect_cleanup
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
143 %! close (hf);
a03bb64031da Implement missing axis tick and label functions (bug #51839).
Nicholas R. Jankowski <jankowskin@asme.org>
parents:
diff changeset
144 %! end_unwind_protect