annotate scripts/plot/private/__quiver__.m @ 12554:4040a95a586d

Revamp quiver autoscaling algorithm (bug #32836).
author Rik <octave@nomad.inbox5.com>
date Thu, 31 Mar 2011 07:33:11 -0700
parents b0084095098e
children e81ddf9cacd5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11523
fd0a3ac60b0e update copyright notices
John W. Eaton <jwe@octave.org>
parents: 11364
diff changeset
1 ## Copyright (C) 2007-2011 David Bateman
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
2 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
3 ## This file is part of Octave.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
4 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
8 ## your option) any later version.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
9 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
13 ## General Public License for more details.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
14 ##
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
18
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8532
diff changeset
19 ## -*- texinfo -*-
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8532
diff changeset
20 ## @deftypefn {Function File} {@var{hg} =} __quiver__ (@dots{})
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8532
diff changeset
21 ## Undocumented internal function.
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8532
diff changeset
22 ## @end deftypefn
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
23
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
24 function hg = __quiver__ (varargin)
7191
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
25
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
26 h = varargin{1};
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
27 is3d = varargin{2};
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
28
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
29 autoscale = 0.9;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
30 arrowsize = 0.2;
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
31
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
32 firstnonnumeric = Inf;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
33 for i = 3:nargin
7191
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
34 if (! isnumeric (varargin{i}))
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
35 firstnonnumeric = i;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
36 break;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
37 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
38 endfor
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
39
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
40 ioff = 3;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
41 if (nargin < (6 + is3d) || firstnonnumeric < (6 + is3d))
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
42 u = varargin{ioff++};
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
43 v = varargin{ioff++};
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
44 if (is3d)
11589
b0084095098e missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
45 w = varargin{ioff++};
8532
4d884a016846 __quiver__.m: __quiver__.m: Fix auto-size of (x,y) coord.
Ben Abbott <bpabbott@mac.com>
parents: 8315
diff changeset
46 [x, y, z] = meshgrid (1:size(u,2), 1:size(u,1), 1:max(size(w)));
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
47 else
8532
4d884a016846 __quiver__.m: __quiver__.m: Fix auto-size of (x,y) coord.
Ben Abbott <bpabbott@mac.com>
parents: 8315
diff changeset
48 [x, y] = meshgrid (1:size(u,2), 1:size(u,1));
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
49 endif
7191
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
50 if (nargin >= ioff && isnumeric (varargin{ioff})
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
51 && isscalar (varargin{ioff}))
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
52 autoscale = varargin{ioff++};
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
53 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
54 else
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
55 x = varargin{ioff++};
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
56 y = varargin{ioff++};
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
57 if (is3d)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
58 z = varargin{ioff++};
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
59 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
60 u = varargin{ioff++};
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
61 v = varargin{ioff++};
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
62 if (is3d)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
63 w = varargin{ioff++};
7191
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
64 if (isvector (x) && isvector (y) && isvector (z)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
65 && (! isvector (u) || ! isvector (v) || ! isvector(w)))
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
66 [x, y, z] = meshgrid (x, y, z);
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
67 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
68 else
7191
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
69 if (isvector (x) && isvector (y) && (! isvector (u) || ! isvector (v)))
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
70 [x, y] = meshgrid (x, y);
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
71 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
72 endif
7191
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
73 if (nargin >= ioff && isnumeric (varargin{ioff})
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
74 && isscalar (varargin{ioff}))
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
75 autoscale = varargin{ioff++};
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
76 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
77 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
78
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
79 have_filled = false;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
80 have_line_spec = false;
8070
3b53b25e2550 Add data sources and line series
David Bateman <dbateman@free.fr>
parents: 8056
diff changeset
81 args = {};
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
82 while (ioff <= nargin)
7191
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
83 arg = varargin{ioff++};
8190
73d6b71788c0 use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents: 8079
diff changeset
84 if (ischar (arg) && strncmpi (arg, "filled", 6))
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
85 have_filled = true;
7768
a2d9f325b65a Use isschar instead of deprecated isstr
Rafael Laboissiere <rafael@debian.org>
parents: 7475
diff changeset
86 elseif ((ischar (arg) || iscell (arg))
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
87 && ! have_line_spec)
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
88 [linespec, valid] = __pltopt__ ("quiver", arg, false);
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
89 if (valid)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
90 have_line_spec = true;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
91 if (strncmp (linespec.linestyle, "none", 4))
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
92 linespec.linestyle = "-";
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
93 endif
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
94 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
95 args {end + 1} = arg;
8070
3b53b25e2550 Add data sources and line series
David Bateman <dbateman@free.fr>
parents: 8056
diff changeset
96 if (ioff <= nargin)
3b53b25e2550 Add data sources and line series
David Bateman <dbateman@free.fr>
parents: 8056
diff changeset
97 args {end + 1} = varargin{ioff++};
3b53b25e2550 Add data sources and line series
David Bateman <dbateman@free.fr>
parents: 8056
diff changeset
98 endif
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
99 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
100 else
8070
3b53b25e2550 Add data sources and line series
David Bateman <dbateman@free.fr>
parents: 8056
diff changeset
101 args {end + 1} = arg;
3b53b25e2550 Add data sources and line series
David Bateman <dbateman@free.fr>
parents: 8056
diff changeset
102 if (ioff <= nargin)
3b53b25e2550 Add data sources and line series
David Bateman <dbateman@free.fr>
parents: 8056
diff changeset
103 args {end + 1} = varargin{ioff++};
3b53b25e2550 Add data sources and line series
David Bateman <dbateman@free.fr>
parents: 8056
diff changeset
104 endif
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
105 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
106 endwhile
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
107
8315
e9687c313d5f Fix callbacks in stem and quiver for change in order of children. Fix for scaling in quiver for single arrow
David Bateman <dbateman@free.fr>
parents: 8190
diff changeset
108 if (autoscale && numel (u) > 1)
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
109 ## Scale the arrows to fit in the grid
12554
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
110 if (isvector (x))
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
111 ny = nx = length (x);
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
112 else
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
113 [nx, ny] = size (x);
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
114 endif
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
115 dx = (max(x(:)) - min(x(:))) ./ nx;
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
116 dy = (max(y(:)) - min(y(:))) ./ ny;
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
117 if (is3d)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
118 dz = (max(z(:)) - min(z(:))) ./ max (size (z));
12554
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
119 len = max (sqrt (u(:).^2 + v(:).^2 + w(:).^2));
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
120 else
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
121 dz = 0;
12554
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
122 len = max (sqrt (u(:).^2 + v(:).^2));
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
123 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
124 if (len > 0)
12554
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
125 sd = sqrt (dx.^2 + dy.^2 + dz.^2) / len;
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
126 if (sd != 0)
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
127 s = sqrt(2) * autoscale * sd;
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
128 else # special case of identical points with multiple vectors
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
129 s = autoscale;
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
130 endif
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
131 uu = s * u;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
132 vv = s * v;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
133 if (is3d)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
134 ww = s*w;
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
135 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
136 endif
8315
e9687c313d5f Fix callbacks in stem and quiver for change in order of children. Fix for scaling in quiver for single arrow
David Bateman <dbateman@free.fr>
parents: 8190
diff changeset
137 else
e9687c313d5f Fix callbacks in stem and quiver for change in order of children. Fix for scaling in quiver for single arrow
David Bateman <dbateman@free.fr>
parents: 8190
diff changeset
138 uu = u;
e9687c313d5f Fix callbacks in stem and quiver for change in order of children. Fix for scaling in quiver for single arrow
David Bateman <dbateman@free.fr>
parents: 8190
diff changeset
139 vv = v;
e9687c313d5f Fix callbacks in stem and quiver for change in order of children. Fix for scaling in quiver for single arrow
David Bateman <dbateman@free.fr>
parents: 8190
diff changeset
140 if (is3d)
e9687c313d5f Fix callbacks in stem and quiver for change in order of children. Fix for scaling in quiver for single arrow
David Bateman <dbateman@free.fr>
parents: 8190
diff changeset
141 ww = w;
e9687c313d5f Fix callbacks in stem and quiver for change in order of children. Fix for scaling in quiver for single arrow
David Bateman <dbateman@free.fr>
parents: 8190
diff changeset
142 endif
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
143 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
144
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
145 hstate = get (h, "nextplot");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
146 unwind_protect
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
147 hg = hggroup ();
8070
3b53b25e2550 Add data sources and line series
David Bateman <dbateman@free.fr>
parents: 8056
diff changeset
148 if (is3d)
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
149 args = __add_datasource__ ("quiver3", hg,
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
150 {"x", "y", "z", "u", "v", "w"}, args{:});
8070
3b53b25e2550 Add data sources and line series
David Bateman <dbateman@free.fr>
parents: 8056
diff changeset
151 else
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
152 args = __add_datasource__ ("quiver", hg,
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
153 {"x", "y", "z", "u", "v", "w"}, args{:});
8070
3b53b25e2550 Add data sources and line series
David Bateman <dbateman@free.fr>
parents: 8056
diff changeset
154 endif
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
155 hold on;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
156
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
157 addproperty ("xdata", hg, "data", x);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
158 addproperty ("ydata", hg, "data", y);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
159
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
160 addproperty ("udata", hg, "data", u);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
161 addproperty ("vdata", hg, "data", v);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
162 if (is3d)
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
163 addproperty ("zdata", hg, "data", z);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
164 addproperty ("wdata", hg, "data", w);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
165 else
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
166 addproperty ("zdata", hg, "data", []);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
167 addproperty ("wdata", hg, "data", []);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
168 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
169
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
170 addlistener (hg, "xdata", @update_data);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
171 addlistener (hg, "ydata", @update_data);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
172 addlistener (hg, "zdata", @update_data);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
173 addlistener (hg, "udata", @update_data);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
174 addlistener (hg, "vdata", @update_data);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
175 addlistener (hg, "wdata", @update_data);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
176
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
177 x = x(:);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
178 y = y(:);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
179 xend = x + uu(:);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
180 yend = y + vv(:);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
181 if (is3d)
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
182 z = z(:);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
183 zend = z + ww(:);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
184 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
185
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
186 if (have_line_spec)
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
187 if (is3d)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
188 h1 = plot3 ([x.'; xend.'; NaN(1, length (x))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
189 [y.'; yend.'; NaN(1, length (y))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
190 [z.'; zend.'; NaN(1, length (z))](:),
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
191 "linestyle", linespec.linestyle,
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
192 "color", linespec.color, "parent", hg);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
193 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
194 h1 = plot ([x.'; xend.'; NaN(1, length (x))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
195 [y.'; yend.'; NaN(1, length (y))](:),
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
196 "linestyle", linespec.linestyle,
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
197 "color", linespec.color, "parent", hg);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
198 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
199 else
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
200 if (is3d)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
201 h1 = plot3 ([x.'; xend.'; NaN(1, length (x))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
202 [y.'; yend.'; NaN(1, length (y))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
203 [z.'; zend.'; NaN(1, length (z))](:),
11364
4cab008d3be1 Use high contrast color black for arrows in quiver3 plots. Bug #31802.
Rik <octave@nomad.inbox5.com>
parents: 11149
diff changeset
204 "color", "black", "parent", hg);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
205 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
206 h1 = plot ([x.'; xend.'; NaN(1, length (x))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
207 [y.'; yend.'; NaN(1, length (y))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
208 "parent", hg);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
209 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
210 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
211
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
212 xtmp = x + uu(:) .* (1 - arrowsize);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
213 ytmp = y + vv(:) .* (1 - arrowsize);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
214 xarrw1 = xtmp + (y - yend) * arrowsize / 3;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
215 xarrw2 = xtmp - (y - yend) * arrowsize / 3;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
216 yarrw1 = ytmp - (x - xend) * arrowsize / 3;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
217 yarrw2 = ytmp + (x - xend) * arrowsize / 3;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
218 if (is3d)
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
219 zarrw1 = zarrw2 = zend - ww(:) * arrowsize;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
220 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
221
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
222 if (have_line_spec)
11149
fe3c3dfc07eb style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents: 10549
diff changeset
223 if (isfield (linespec, "marker")
fe3c3dfc07eb style fix: break lines before && and ||, not after
John W. Eaton <jwe@octave.org>
parents: 10549
diff changeset
224 && ! strncmp (linespec.marker, "none", 4))
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
225 if (is3d)
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
226 h2 = plot3 ([xarrw1.'; xend.'; xarrw2.'; NaN(1, length (x))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
227 [yarrw1.'; yend.'; yarrw2.'; NaN(1, length (y))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
228 [zarrw1.'; zend.'; zarrw2.'; NaN(1, length (z))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
229 "linestyle", "none", "parent", hg);
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
230 else
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
231 h2 = plot ([xarrw1.'; xend.'; xarrw2.'; NaN(1, length (x))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
232 [yarrw1.'; yend.'; yarrw2.'; NaN(1, length (y))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
233 "linestyle", "none", "parent", hg);
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
234 endif
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
235 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
236 if (is3d)
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
237 h2 = plot3 ([xarrw1.'; xend.'; xarrw2.'; NaN(1, length (x))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
238 [yarrw1.'; yend.'; yarrw2.'; NaN(1, length (y))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
239 [zarrw1.'; zend.'; zarrw2.'; NaN(1, length (z))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
240 "linestyle", linespec.linestyle,
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
241 "color", linespec.color, "parent", hg);
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
242 else
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
243 h2 = plot ([xarrw1.'; xend.'; xarrw2.'; NaN(1, length (x))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
244 [yarrw1.'; yend.'; yarrw2.'; NaN(1, length (y))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
245 "linestyle", linespec.linestyle,
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
246 "color", linespec.color, "parent", hg);
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
247 endif
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
248 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
249 elseif (is3d)
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
250 h2 = plot3 ([xarrw1.'; xend.'; xarrw2.'; NaN(1, length (x))](:),
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
251 [yarrw1.'; yend.'; yarrw2.'; NaN(1, length (y))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
252 [zarrw1.'; zend.'; zarrw2.'; NaN(1, length (z))](:),
11364
4cab008d3be1 Use high contrast color black for arrows in quiver3 plots. Bug #31802.
Rik <octave@nomad.inbox5.com>
parents: 11149
diff changeset
253 "color", "black", "parent", hg);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
254 else
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
255 h2 = plot ([xarrw1.'; xend.'; xarrw2.'; NaN(1, length (x))](:),
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
256 [yarrw1.'; yend.'; yarrw2.'; NaN(1, length (y))](:),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
257 "parent", hg);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
258 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
259
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
260 if (! have_line_spec
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
261 || (isfield (linespec, "marker")
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
262 && strncmp (linespec.marker, "none", 4)))
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
263 if (is3d)
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
264 h3 = plot3 (x, y, z, "linestyle", "none", "marker", "none",
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
265 "parent", hg);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
266 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
267 h3 = plot (x, y, "linestyle", "none", "marker", "none", "parent", hg);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
268 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
269 else
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
270 if (is3d)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
271 h3 = plot3 (x, y, z, "linestyle", "none", "marker", linespec.marker,
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
272 "parent", hg);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
273 else
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
274
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
275 h3 = plot (x, y, "linestyle", "none", "marker", linespec.marker,
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
276 "parent", hg);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
277 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
278 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
279 if (have_filled)
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
280 ## FIXME gnuplot doesn't respect the markerfacecolor field
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
281 set (h3, "markerfacecolor", get (h1, "color"));
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
282 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
283
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
284 ## Set up the hggroup properties and listeners
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
285 if (autoscale)
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
286 addproperty ("autoscale", hg, "radio", "{on}|off", "on");
11589
b0084095098e missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
287 addproperty ("autoscalefactor", hg, "data", autoscale);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
288 else
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
289 addproperty ("autoscale", hg, "radio", "{on}|off", "off");
11589
b0084095098e missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
290 addproperty ("autoscalefactor", hg, "data", 1.0);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
291 endif
11589
b0084095098e missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
292 addlistener (hg, "autoscale", @update_data);
b0084095098e missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
293 addlistener (hg, "autoscalefactor", @update_data);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
294
11589
b0084095098e missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
295 addproperty ("maxheadsize", hg, "data", arrowsize);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
296 addlistener (hg, "maxheadsize", @update_data);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
297
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
298 addproperty ("showarrowhead", hg, "radio", "{on}|off", "on");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
299 addlistener (hg, "showarrowhead", @update_props);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
300
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
301 addproperty ("color", hg, "linecolor", get (h1, "color"));
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
302 addproperty ("linewidth", hg, "linelinewidth", get (h1, "linewidth"));
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
303 addproperty ("linestyle", hg, "linelinestyle", get (h1, "linestyle"));
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
304 addproperty ("marker", hg, "linemarker", get (h3, "marker"));
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
305 addproperty ("markerfacecolor", hg, "linemarkerfacecolor",
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
306 get (h3, "markerfacecolor"));
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
307 addproperty ("markersize", hg, "linemarkersize", get (h3, "markersize"));
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
308
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
309 addlistener (hg, "color", @update_props);
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
310 addlistener (hg, "linewidth", @update_props);
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
311 addlistener (hg, "linestyle", @update_props);
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
312 addlistener (hg, "marker", @update_props);
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
313 addlistener (hg, "markerfacecolor", @update_props);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
314 addlistener (hg, "markersize", @update_props);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
315
8079
082fa7859574 Additional do not call set with empty arguments fixes
David Bateman <dbateman@free.fr>
parents: 8075
diff changeset
316 if (! isempty (args))
082fa7859574 Additional do not call set with empty arguments fixes
David Bateman <dbateman@free.fr>
parents: 8075
diff changeset
317 set (hg, args{:});
082fa7859574 Additional do not call set with empty arguments fixes
David Bateman <dbateman@free.fr>
parents: 8075
diff changeset
318 endif
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
319 unwind_protect_cleanup
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
320 set (h, "nextplot", hstate);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
321 end_unwind_protect
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
322
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
323 endfunction
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
324
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
325 function update_data (h, d)
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
326 x = get (h, "xdata");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
327 y = get (h, "ydata");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
328 z = get (h, "zdata");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
329
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
330 u = get (h, "udata");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
331 v = get (h, "vdata");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
332 w = get (h, "wdata");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
333
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
334 s = get (h, "autoscalefactor");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
335 arrowsize = get (h, "maxheadsize");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
336
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
337 kids = get (h, "children");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
338
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
339 if (isempty (z) || isempty (w))
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
340 is3d = false;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
341 else
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
342 is3d = true;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
343 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
344
8190
73d6b71788c0 use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents: 8079
diff changeset
345 if (strcmpi (get (h, "autoscale"), "on") && s != 0)
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
346 ## Scale the arrows to fit in the grid
12554
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
347 if (isvector (x))
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
348 ny = nx = length (x);
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
349 else
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
350 [nx, ny] = size (x);
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
351 endif
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
352 dx = (max(x(:)) - min(x(:))) ./ nx;
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
353 dy = (max(y(:)) - min(y(:))) ./ ny;
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
354 if (is3d)
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
355 dz = (max(z(:)) - min(z(:))) ./ max (size (z));
12554
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
356 len = max (sqrt (u(:).^2 + v(:).^2 + w(:).^2));
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
357 else
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
358 dz = 0;
12554
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
359 len = max (sqrt (u(:).^2 + v(:).^2));
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
360 endif
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
361 if (len > 0)
12554
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
362 sd = sqrt (dx.^2 + dy.^2 + dz.^2) / len;
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
363 if (sd != 0)
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
364 s *= sqrt(2) * sd;
4040a95a586d Revamp quiver autoscaling algorithm (bug #32836).
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
365 endif
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
366 u = s * u;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
367 v = s * v;
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
368 if (is3d)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
369 w = s*w;
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
370 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
371 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
372 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
373
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
374 x = x(:);
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
375 y = y(:);
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
376 xend = x + u(:);
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
377 yend = y + v(:);
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
378 if (is3d)
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
379 z = z(:);
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
380 zend = z + w(:);
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
381 endif
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
382
8315
e9687c313d5f Fix callbacks in stem and quiver for change in order of children. Fix for scaling in quiver for single arrow
David Bateman <dbateman@free.fr>
parents: 8190
diff changeset
383 set (kids (3), "xdata", [x.'; xend.'; NaN(1, length (x))](:));
e9687c313d5f Fix callbacks in stem and quiver for change in order of children. Fix for scaling in quiver for single arrow
David Bateman <dbateman@free.fr>
parents: 8190
diff changeset
384 set (kids (3), "ydata", [y.'; yend.'; NaN(1, length (y))](:));
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
385 if (is3d)
8315
e9687c313d5f Fix callbacks in stem and quiver for change in order of children. Fix for scaling in quiver for single arrow
David Bateman <dbateman@free.fr>
parents: 8190
diff changeset
386 set (kids (3), "zdata", [z.'; zend.'; NaN(1, length (z))](:));
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
387 endif
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
388
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
389 xtmp = x + u(:) .* (1 - arrowsize);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
390 ytmp = y + v(:) .* (1 - arrowsize);
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
391 xarrw1 = xtmp + (y - yend) * arrowsize / 3;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
392 xarrw2 = xtmp - (y - yend) * arrowsize / 3;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
393 yarrw1 = ytmp - (x - xend) * arrowsize / 3;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
394 yarrw2 = ytmp + (x - xend) * arrowsize / 3;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
395 if (is3d)
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
396 zarrw1 = zarrw2 = zend - w(:) * arrowsize;
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
397 endif
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
398
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
399 set (kids (2), "xdata", [x.'; xend.'; NaN(1, length (x))](:));
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
400 set (kids (2), "ydata", [y.'; yend.'; NaN(1, length (y))](:));
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
401 if (is3d)
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
402 set (kids (2), "zdata", [z.'; zend.'; NaN(1, length (z))](:));
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
403 endif
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
404
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
405 set (kids (2), "xdata", [xarrw1.'; xend.'; xarrw2.'; NaN(1, length (x))](:));
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
406 set (kids (2), "ydata", [yarrw1.'; yend.'; yarrw2.'; NaN(1, length (y))](:));
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
407 if (is3d)
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
408 set (kids (2), "zdata", [zarrw1.'; zend.'; zarrw2.'; NaN(1, length (z))](:));
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
409 endif
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
410
8315
e9687c313d5f Fix callbacks in stem and quiver for change in order of children. Fix for scaling in quiver for single arrow
David Bateman <dbateman@free.fr>
parents: 8190
diff changeset
411 set (kids (1), "xdata", x);
e9687c313d5f Fix callbacks in stem and quiver for change in order of children. Fix for scaling in quiver for single arrow
David Bateman <dbateman@free.fr>
parents: 8190
diff changeset
412 set (kids (1), "ydata", y);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
413 if (is3d)
8315
e9687c313d5f Fix callbacks in stem and quiver for change in order of children. Fix for scaling in quiver for single arrow
David Bateman <dbateman@free.fr>
parents: 8190
diff changeset
414 set (kids (1), "zdata", z);
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
415 endif
7189
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
416
e8d953d03f6a [project @ 2007-11-26 20:42:09 by dbateman]
dbateman
parents:
diff changeset
417 endfunction
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
418
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
419 function update_props (h, d)
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
420 kids = get (h, "children");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
421
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
422 set (kids(3), "color", get (h, "color"),
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
423 "linewidth", get (h, "linewidth"),
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
424 "linestyle", get (h, "linestyle"));
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
425 set (kids(2), "color", get (h, "color"),
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
426 "linewidth", get (h, "linewidth"),
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
427 "linestyle", get (h, "linestyle"));
8190
73d6b71788c0 use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents: 8079
diff changeset
428 if (strcmpi (get (h, "showarrowhead"), "on"))
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
429 set (kids (2), "visible", "on");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
430 else
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
431 set (kids (2), "visible", "off");
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
432 endif
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
433 set (kids(1), "color", get (h, "color"),
8056
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
434 "marker", get (h, "marker"),
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
435 "markerfacecolor", get (h, "markerfacecolor"),
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
436 "markersize", get (h, "markersize"));
9a6f4713f765 Add area, bar, quiver and stair series graphics objects. Document them
David Bateman <dbateman@free.fr>
parents: 7768
diff changeset
437 endfunction