0% found this document useful (0 votes)
17 views3 pages

Function File

This document describes the quiver function in Octave, which plots 2D vector fields. It can plot vectors given (u,v) components on a uniform or non-uniform grid. The s argument scales arrow sizes relative to grid spacing, and style/markers can be used to change the plot appearance. An optional h return handles the plot for later modification. Examples demonstrate basic usage and scaling arrows on a sine wave.

Uploaded by

Luis Carlos M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views3 pages

Function File

This document describes the quiver function in Octave, which plots 2D vector fields. It can plot vectors given (u,v) components on a uniform or non-uniform grid. The s argument scales arrow sizes relative to grid spacing, and style/markers can be used to change the plot appearance. An optional h return handles the plot for later modification. Examples demonstrate basic usage and scaling arrows on a sine wave.

Uploaded by

Luis Carlos M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Function File: quiver (u, v)

Function File: quiver (x, y, u, v)


Function File: quiver (, s)
Function File: quiver (, style)
Function File: quiver (, "filled")
Function File: quiver (hax, )
Function File: h = quiver ()
Plot a 2-D vector field with arrows.
Plot the (u, v) components of a vector field in an (x, y) meshgrid. If the grid is
uniform then x and y can be specified as vectors.
If x and y are undefined they are assumed to be (1:m,

1:n)

where [m,

n] = size (u).

The variable s is a scalar defining a scaling factor to use for the arrows of the field
relative to the mesh spacing. A value of 0 disables all scaling. The default value is
0.9.
The style to use for the plot can be defined with a line style style of the same format
as the plot command. If a marker is specified then markers at the grid points of the
vectors are drawn rather than arrows. If the argument "filled" is given then the
markers are filled.
If the first argument hax is an axes handle, then plot into this axis, rather than the
current axes returned by gca.
The optional return value h is a graphics handle to a quiver object. A quiver object
regroups the components of the quiver plot (body, arrow, and marker), and allows
them to be changed together.
Example:
[x, y] = meshgrid (1:2:20);
h = quiver (x, y, sin (2*pi*x/10), sin (2*pi*y/10));
set (h, "maxheadsize", 0.33);

See also: quiver3, compass, feather, plot.

Demonstration 1
The following code
clf;
[x,y] = meshgrid (1:2:20);
h = quiver (x,y, sin (2*pi*x/10), sin (2*pi*y/10));
title ('quiver plot')

Produces the following figure

Figure 1

Demonstration 2
The following code
clf;
x = linspace (0, 3, 80);
y = sin (2*pi*x);
theta = 2*pi*x + pi/2;
quiver (x, y, sin (theta)/10, cos (theta)/10, 0.4);
axis equal tight;
hold on; plot (x,y,'r'); hold off;
title ('quiver() with scaled arrows');

Produces the following figure

Figure 1

Package: octave

You might also like