Mercurial > octave
annotate scripts/plot/appearance/daspect.m @ 27919:1891570abac8
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2020.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 06 Jan 2020 22:29:51 -0500 |
parents | b442ec6dda5c |
children | bd51beb6205e |
rev | line source |
---|---|
27919
1891570abac8
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27918
diff
changeset
|
1 ## Copyright (C) 2010-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
|
2 ## |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
3 ## See the file COPYRIGHT.md in the top-level directory of this distribution |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
4 ## or <https://octave.org/COPYRIGHT.html/>. |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
5 ## |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11563
diff
changeset
|
6 ## |
11104 | 7 ## This file is part of Octave. |
8 ## | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
9 ## Octave is free software: you can redistribute it and/or modify it |
11104 | 10 ## 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:
23220
diff
changeset
|
11 ## the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
12 ## (at your option) any later version. |
11104 | 13 ## |
14 ## Octave is distributed in the hope that it will be useful, but | |
15 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
17 ## GNU General Public License for more details. |
11104 | 18 ## |
10218
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
19 ## You should have received a copy of the GNU General Public License |
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
20 ## 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:
23220
diff
changeset
|
21 ## <https://www.gnu.org/licenses/>. |
10218
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
22 |
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
23 ## -*- texinfo -*- |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
24 ## @deftypefn {} {@var{data_aspect_ratio} =} daspect () |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
25 ## @deftypefnx {} {} daspect (@var{data_aspect_ratio}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
26 ## @deftypefnx {} {} daspect (@var{mode}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
27 ## @deftypefnx {} {@var{data_aspect_ratio_mode} =} daspect ("mode") |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
28 ## @deftypefnx {} {} daspect (@var{hax}, @dots{}) |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
16491
diff
changeset
|
29 ## Query or set the data aspect ratio of the current axes. |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
16491
diff
changeset
|
30 ## |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
16491
diff
changeset
|
31 ## The aspect ratio is a normalized 3-element vector representing the span of |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
16491
diff
changeset
|
32 ## the x, y, and z-axis limits. |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
33 ## |
17578
7af442c326a8
daspect.m: Remove unnecessary () enclosing code sample in docstring.
Rik <rik@octave.org>
parents:
17572
diff
changeset
|
34 ## @code{daspect (@var{mode})} |
16491
b10a23fe80bb
doc: Tweak docstrings of functions changed for Texinfo 5.0 compatibility.
Rik <rik@octave.org>
parents:
16489
diff
changeset
|
35 ## |
b10a23fe80bb
doc: Tweak docstrings of functions changed for Texinfo 5.0 compatibility.
Rik <rik@octave.org>
parents:
16489
diff
changeset
|
36 ## Set the data aspect ratio mode of the current axes. @var{mode} is |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17154
diff
changeset
|
37 ## either @qcode{"auto"} or @qcode{"manual"}. |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
38 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17154
diff
changeset
|
39 ## @code{daspect (@qcode{"mode"})} |
16491
b10a23fe80bb
doc: Tweak docstrings of functions changed for Texinfo 5.0 compatibility.
Rik <rik@octave.org>
parents:
16489
diff
changeset
|
40 ## |
b10a23fe80bb
doc: Tweak docstrings of functions changed for Texinfo 5.0 compatibility.
Rik <rik@octave.org>
parents:
16489
diff
changeset
|
41 ## Return the data aspect ratio mode of the current axes. |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
42 ## |
16491
b10a23fe80bb
doc: Tweak docstrings of functions changed for Texinfo 5.0 compatibility.
Rik <rik@octave.org>
parents:
16489
diff
changeset
|
43 ## @code{daspect (@var{hax}, @dots{})} |
b10a23fe80bb
doc: Tweak docstrings of functions changed for Texinfo 5.0 compatibility.
Rik <rik@octave.org>
parents:
16489
diff
changeset
|
44 ## |
b10a23fe80bb
doc: Tweak docstrings of functions changed for Texinfo 5.0 compatibility.
Rik <rik@octave.org>
parents:
16489
diff
changeset
|
45 ## Operate on the axes in handle @var{hax} instead of the current axes. |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
46 ## |
10218
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
47 ## @seealso{axis, pbaspect, xlim, ylim, zlim} |
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
48 ## @end deftypefn |
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
49 |
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
50 ## Author: Ben Abbott <bpabbott@mac.com> |
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
51 ## Created: 2010-01-26 |
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
52 |
17154
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
53 function daratio = daspect (varargin) |
10218
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
54 |
17154
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
55 ## Grab axes handle if present |
10218
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
56 if (nargin > 0) |
17154
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
57 if (isscalar (varargin{1}) && isaxes (varargin{1})) |
10218
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
58 hax = varargin{1}; |
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
59 varargin = varargin(2:end); |
17154
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
60 else |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
61 hax = gca (); |
10218
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
62 endif |
17154
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
63 else |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
64 hax = gca (); |
10218
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
65 endif |
17154
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
66 |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
67 nargin = numel (varargin); |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
68 if (nargin > 1) |
10218
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
69 print_usage (); |
11113
a8ac114ec9ab
Stylefixes, replace end by endif.
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
11104
diff
changeset
|
70 endif |
10218
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
71 |
17154
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
72 if (nargin == 0) |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
73 daratio = get (hax, "dataaspectratio"); |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
74 else |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
75 arg = varargin{1}; |
17579
0c6750ace8b4
Fix input processing of 'mode' for daspect, pbaspect.
Rik <rik@octave.org>
parents:
17578
diff
changeset
|
76 if (isnumeric (arg)) |
17154
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
77 if (numel (arg) == 2) |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
78 set (hax, "dataaspectratio", [arg, 1]); |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
79 elseif (numel (arg) == 3) |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
80 set (hax, "dataaspectratio", arg); |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
81 else |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
82 error ("daspect: DATA_ASPECT_RATIO must be a 2 or 3 element vector"); |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
83 endif |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
84 elseif (ischar (arg)) |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
85 arg = tolower (arg); |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
86 switch (arg) |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
87 case "auto" |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
88 set (hax, "dataaspectratiomode", "auto"); |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
89 case "manual" |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
90 set (hax, "dataaspectratiomode", "manual"); |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
91 case "mode" |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
92 daratio = get (hax, "dataaspectratiomode"); |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
93 otherwise |
22760
c4d80b9d2898
maint: Capitalize variable names appearing in error() messages of m-files.
Rik <rik@octave.org>
parents:
22755
diff
changeset
|
94 error ("daspect: Invalid MODE <%s>", arg); |
17154
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
95 endswitch |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
96 else |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
97 print_usage (); |
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
98 endif |
11113
a8ac114ec9ab
Stylefixes, replace end by endif.
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
11104
diff
changeset
|
99 endif |
10218
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
100 |
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
101 endfunction |
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
102 |
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
103 |
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
104 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
105 %! clf; |
10218
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
106 %! x = 0:0.01:4; |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
107 %! plot (x,cos(x), x,sin(x)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
108 %! axis square; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
109 %! daspect ([1 1 1]); |
22312
533c3c4059a3
Add titles to more of the graphic demos.
Rik <rik@octave.org>
parents:
22302
diff
changeset
|
110 %! title ("square plot box with axis limits [0, 4, -2, 2]"); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
111 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
112 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
113 %! clf; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
114 %! x = 0:0.01:4; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
115 %! plot (x,cos (x), x,sin (x)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
116 %! axis ([0 4 -1 1]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
117 %! daspect ([2 1 1]); |
22312
533c3c4059a3
Add titles to more of the graphic demos.
Rik <rik@octave.org>
parents:
22302
diff
changeset
|
118 %! title ("square plot box with axis limits [0, 4, -1, 1]"); |
10218
ce94aaa71a4f
daspect.m, pbaspect.m: New functions.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
119 |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10711
diff
changeset
|
120 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
121 %! clf; |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10711
diff
changeset
|
122 %! x = 0:0.01:4; |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
123 %! plot (x,cos(x), x,sin(x)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
124 %! daspect ([1 2 1]); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
125 %! pbaspect ([2 1 1]); |
22302
1c4cd12987f5
Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents:
20852
diff
changeset
|
126 %! title ("2x1 plot box with axis limits [0, 4, -2, 2]"); |
11161
2e32236eaa90
Add demos setting both data and plotbox aspect ratios.
Ben Abbott <bpabbott@mac.com>
parents:
11120
diff
changeset
|
127 |
2e32236eaa90
Add demos setting both data and plotbox aspect ratios.
Ben Abbott <bpabbott@mac.com>
parents:
11120
diff
changeset
|
128 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
129 %! clf; |
11161
2e32236eaa90
Add demos setting both data and plotbox aspect ratios.
Ben Abbott <bpabbott@mac.com>
parents:
11120
diff
changeset
|
130 %! x = 0:0.01:4; |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
131 %! plot (x,cos(x), x, sin(x)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
132 %! axis square; |
22302
1c4cd12987f5
Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents:
20852
diff
changeset
|
133 %! set (gca, "activepositionproperty", "position"); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
134 %! daspect ([1 1 1]); |
22312
533c3c4059a3
Add titles to more of the graphic demos.
Rik <rik@octave.org>
parents:
22302
diff
changeset
|
135 %! title ("square plot box with axis limits [0, 4, -2, 2]"); |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10711
diff
changeset
|
136 |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10711
diff
changeset
|
137 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
138 %! clf; |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10711
diff
changeset
|
139 %! x = 0:0.01:4; |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
140 %! plot (x,cos(x), x,sin(x)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
141 %! axis ([0 4 -1 1]); |
22302
1c4cd12987f5
Use Octave syntax in graphics demos.
Rik <rik@octave.org>
parents:
20852
diff
changeset
|
142 %! set (gca, "activepositionproperty", "position"); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
143 %! daspect ([2 1 1]); |
22312
533c3c4059a3
Add titles to more of the graphic demos.
Rik <rik@octave.org>
parents:
22302
diff
changeset
|
144 %! title ("square plot box with axis limits [0, 4, -1, 1]"); |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10711
diff
changeset
|
145 |
17154
57312b5426cf
daspect.m: Overhaul function using modern coding practices.
Rik <rik@octave.org>
parents:
17122
diff
changeset
|
146 ## FIXME: need some input validation tests |