Functions | |
if (nargin< (6+is3d)||firstnonnumeric< (6+is3d)) u | |
if (is3d) w | |
endif | if (nargin >=ioff &&isnumeric(varargin{ioff})&&isscalar(varargin{ioff})) autoscale |
if (isvector(x)&&isvector(y)&&isvector(z)&&(!isvector(u)||!isvector(v)||!isvector(w)))[x | |
endif else | if (isvector(x)&&isvector(y)&&(!isvector(u)||!isvector(v)))[x |
while (ioff<=nargin) arg | |
if (ischar(arg)&&strncmpi(arg,"filled", 6)) have_filled | |
elseif ((ischar(arg)||iscell(arg))&&!have_line_spec)[linespec | |
if (valid) have_line_spec | |
if (strncmp(linespec.linestyle,"none", 4)) linespec.linestyle | |
if (ioff<=nargin) args | |
endif endif endwhile | if (autoscale &&numel(u) > 1) dx |
endif | if (len > 0) s |
addproperty ("xdata", hg,"data", x) | |
addproperty ("ydata", hg,"data", y) | |
addproperty ("udata", hg,"data", u) | |
addproperty ("vdata", hg,"data", v) | |
addproperty ("wdata", hg,"data", w) | |
else | addproperty ("zdata", hg,"data",[]) |
addproperty ("wdata", hg,"data",[]) | |
endif | addlistener (hg,"xdata",@update_data) |
addlistener (hg,"ydata",@update_data) | |
addlistener (hg,"zdata",@update_data) | |
addlistener (hg,"udata",@update_data) | |
addlistener (hg,"vdata",@update_data) | |
addlistener (hg,"wdata",@update_data) | |
endif | if (have_line_spec) if(is3d) h1 |
endif marker && | !strncmp (linespec.marker,"none", 4)) if(is3d) h2 |
endif endif | elseif (is3d) h2 |
endif | if (!have_line_spec||(isfield(linespec,"marker")&&strncmp(linespec.marker,"none", 4))) if(is3d) h3 |
endif endif | if (have_filled) set(h3 |
endif endif | get (h1,"color")) |
endif | if (autoscale) addproperty("autoscale" |
Variables | |
function | hg |
is3d = varargin{2} | |
autoscale = 0.9 | |
arrowsize = 0.2 | |
firstnonnumeric = Inf | |
for | i |
break | |
endif endfor | ioff = 3 |
v = varargin{ioff++} | |
else [x, y] = meshgrid (1:size(u,2), 1:size(u,1)) | |
endif else | x = varargin{ioff++} |
y = varargin{ioff++} | |
endif | u = varargin{ioff++} |
z = meshgrid (x, y, z) | |
endif endif | have_filled = false |
have_line_spec = false | |
args = {} | |
valid = __pltopt__ ("quiver", arg, false) | |
dy = (max(y(:)) - min(y(:))) ./ size (y, 1) | |
len = max (sqrt (u(:).^2 + dy(:).^2) + dz(:).^2) | |
dz = 0 | |
uu = s * u | |
vv = s * v | |
endif endif | hstate = get (h, "nextplot") |
endif hold | on |
data | |
xend = x + uu(:) | |
yend = y + vv(:) | |
zend = z + ww(:) | |
else | h1 |
endif endif | xtmp = x + uu(:) .* (1 - arrowsize) |
ytmp = y + vv(:) .* (1 - arrowsize) | |
xarrw1 = xtmp + (y - yend) * arrowsize / 3 | |
xarrw2 = xtmp - (y - yend) * arrowsize / 3 | |
yarrw1 = ytmp - (x - xend) * arrowsize / 3 | |
yarrw2 = ytmp + (x - xend) * arrowsize / 3 | |
else | h2 |
else | h3 = plot (x, y, "linestyle", "none", "marker", "none", "parent", hg) |
endif endif | markerfacecolor |
endif | radio |
addlistener | ( | hg | , | |
"wdata" | , | |||
@ | update_data | |||
) |
addlistener | ( | hg | , | |
"vdata" | , | |||
@ | update_data | |||
) |
addlistener | ( | hg | , | |
"udata" | , | |||
@ | update_data | |||
) |
addlistener | ( | hg | , | |
"zdata" | , | |||
@ | update_data | |||
) |
addlistener | ( | hg | , | |
"ydata" | , | |||
@ | update_data | |||
) |
addproperty | ( | "wdata" | , | |
hg | , | |||
"data" | ||||
) |
addproperty | ( | "wdata" | , | |
hg | , | |||
"data" | , | |||
w | ||||
) |
addproperty | ( | "vdata" | , | |
hg | , | |||
"data" | , | |||
v | ||||
) |
addproperty | ( | "ydata" | , | |
hg | , | |||
"data" | , | |||
y | ||||
) |
addproperty | ( | "xdata" | , | |
hg | , | |||
"data" | , | |||
x | ||||
) |
elseif | ( | (ischar(arg)||iscell(arg))&&! | have_line_spec | ) |
endif endif if | ( | have_filled | ) |
endif if | ( | !have_line_spec|| | isfield(linespec,"marker")&&strncmp(linespec.marker,"none", 4) | ) |
endif if | ( | have_line_spec | ) |
if | ( | ioff<= | nargin | ) |
if | ( | strncmp(linespec.linestyle,"none", 4) | ) |
if | ( | valid | ) |
if | ( | ischar(arg)&&strncmpi(arg,"filled", 6) | ) |
if | ( | isvector(x)&&isvector(y)&&isvector(z)&&(!isvector(u)||!isvector(v)||!isvector(w)) | ) |
if | ( | is3d | ) |
if | ( | ) |
while | ( | ioff<= | nargin | ) |
id arrowsize = 0.2 |
autoscale = 0.9 |
break |
dy = (max(y(:)) - min(y(:))) ./ size (y, 1) |
dz = 0 |
firstnonnumeric = Inf |
else h2 |
endif endif have_filled = false |
have_line_spec = false |
is3d = varargin{2} |
v = varargin{ioff++} |
valid = __pltopt__ ("quiver", arg, false) |
vv = s * v |
x = varargin{ioff++} |
y = varargin{ioff++} |
z = meshgrid (x, y, z) |
zend = z + ww(:) |