Main Content

quiver3m

Project 3-D quiver plot on axesm-based map

    Description

    quiver3m(lat,lon,z,dlat,dlon,dz) plots a 3-D quiver plot on the current axesm-based map. The quiver plot has arrows with directional components dlat, dlon, and dz at the geographic coordinates specified by lat and lon with altitude z. For example, the first arrow originates from the point lat(1), lon(1), and z(1), extends in the direction of the latitude axis according to dlat(1), extends in the direction of the longitude axis according to dlon(1), and extends in the direction of the z-axis according to dz(1). By default, the function scales the arrow lengths so that they do not overlap.

    example

    quiver3m(lat,lon,z,dlat,dlon,dz,scale) adjusts the length of arrows:

    • When scale is a positive number, the function automatically adjusts the lengths of arrows so they do not overlap, then stretches them by a factor of scale. For example, a scale of 2 doubles the length of arrows, and a scale of 0.5 halves the length of arrows.

    • When scale is "off" or 0, such as quiver3m(lat,lon,z,dlat,dlon,dz,"off"), the function does not perform automatic scaling.

    quiver3m(lat,lon,z,dlat,dlon,dz,LineSpec) specifies the line style, marker, and color. Markers appear at the points specified by lat, lon, and z. If you specify a marker using LineSpec, the function does not display arrowheads.

    quiver3m(lat,lon,z,dlat,dlon,dz,LineSpec,scale) adjusts the lengths of the arrows and specifies the line style, marker, and color.

    quiver3m(lat,lon,z,dlat,dlon,dz,LineSpec,"filled") fills the markers specified by LineSpec.

    quiver3m(lat,lon,z,dlat,dlon,dz,LineSpec,scale,"filled") adjusts the lengths of the arrows and fills the markers and fills the markers specified by LineSpec.

    h = quiver3m(___) returns the quiver plot, using any combination of input arguments from the previous syntaxes.

    Examples

    collapse all

    Load sample data that represents air currents into the workspace, and select a subset of the data. Specify lon and dz by scaling the original data.

    load wind
    lat = y(13:19,13:19,1);
    lon = -x(13:19,13:19,1);
    z = z(13:19,13:19,1);
    dlat = v(13:19,13:19,1);
    dlon = u(13:19,13:19,1);
    dz = 500*w(13:19,13:19,1);

    Create a map and display a 3-D quiver plot of the subset you selected. The matrices lat, lon, and z represent the location of the base of each arrow, and dlat, dlon, and dz represent the directional components of each arrow. By default, the quiver3m function shortens the arrows so they do not overlap.

    figure
    axesm miller
    axis off
    
    quiver3m(lat,lon,z,dlat,dlon,dz)
    view(3)

    Figure contains an axes object. The hidden axes object contains 2 objects of type line.

    Input Arguments

    collapse all

    Latitude coordinates of the bases of the arrows, specified as a scalar, a vector, or a matrix.

    The sizes of lat, lon, z, dlat, dlon, and dz must match.

    Specify this argument using units that match the AngleUnits property of the axesm-based map.

    Data Types: double

    Longitude coordinates of the bases of the arrows, specified as a scalar, a vector, or a matrix.

    The sizes of lat, lon, z, dlat, dlon, and dz must match.

    Specify this argument using units that match the AngleUnits property of the axesm-based map.

    Data Types: double

    Altitudes of the bases of the arrows, specified as a scalar, a vector, or a matrix.

    The sizes of lat, lon, z, dlat, dlon, and dz must match.

    When the MapProjection property of the axesm-based map is 'globe', z is referenced to the ellipsoid.

    The units of z must match the units of dz.

    Data Types: double

    Latitude components of the arrows, specified as a scalar, vector, or matrix.

    The sizes of lat, lon, z, dlat, dlon, and dz must match.

    Specify this argument using units that match the AngleUnits property of the axesm-based map.

    Data Types: single | double

    Longitude components of the arrows, specified as a scalar, vector, or matrix.

    The sizes of lat, lon, z, dlat, dlon, and dz must match.

    Specify this argument using units that match the AngleUnits property of the axesm-based map.

    Data Types: single | double

    Altitude components of the arrows, specified as a scalar, vector, or matrix.

    The sizes of lat, lon, z, dlat, dlon, and dz must match.

    When the MapProjection property of the axesm-based map is 'globe', dz is referenced to the ellipsoid.

    The units of dz must match the units of z.

    Data Types: single | double

    Line style, marker, and color, specified as a character vector or string scalar containing symbols. The symbols can appear in any order. You do not need to specify all three characteristics (line style, marker, and color).

    If you specify a marker using LineSpec, then the quiver3m function does not display arrowheads.

    Example: "--or" is a red dashed line with circle markers

    Line StyleDescriptionResulting Line
    "-"Solid line

    Sample of solid line

    "--"Dashed line

    Sample of dashed line

    ":"Dotted line

    Sample of dotted line

    "-."Dash-dotted line

    Sample of dash-dotted line, with alternating dashes and dots

    MarkerDescriptionResulting Marker
    "o"Circle

    Sample of circle marker

    "+"Plus sign

    Sample of plus sign marker

    "*"Asterisk

    Sample of asterisk marker

    "."Point

    Sample of point marker

    "x"Cross

    Sample of cross marker

    "_"Horizontal line

    Sample of horizontal line marker

    "|"Vertical line

    Sample of vertical line marker

    "square"Square

    Sample of square marker

    "diamond"Diamond

    Sample of diamond marker

    "^"Upward-pointing triangle

    Sample of upward-pointing triangle marker

    "v"Downward-pointing triangle

    Sample of downward-pointing triangle marker

    ">"Right-pointing triangle

    Sample of right-pointing triangle marker

    "<"Left-pointing triangle

    Sample of left-pointing triangle marker

    "pentagram"Pentagram

    Sample of pentagram marker

    "hexagram"Hexagram

    Sample of hexagram marker

    Color NameShort NameRGB TripletAppearance
    "red""r"[1 0 0]

    Sample of the color red

    "green""g"[0 1 0]

    Sample of the color green

    "blue""b"[0 0 1]

    Sample of the color blue

    "cyan" "c"[0 1 1]

    Sample of the color cyan

    "magenta""m"[1 0 1]

    Sample of the color magenta

    "yellow""y"[1 1 0]

    Sample of the color yellow

    "black""k"[0 0 0]

    Sample of the color black

    "white""w"[1 1 1]

    Sample of the color white

    Arrow scaling factor, specified as a nonnegative number or "off". By default, the quiver3m function automatically scales the arrows so they do not overlap. The quiver3m function applies the specified scaling factor after it automatically scales the arrows.

    To turn off automatic scaling, specify scale as "off" or 0. When you specify either of these values, the function plots the arrows from (lat, lon, z) to (lat+dlat, lon+dlon, z+dz).

    Output Arguments

    collapse all

    Quiver plot, returned as a vector of Line objects.

    Version History

    Introduced before R2006a

    See Also

    Functions