主要内容

本页采用了机器翻译。点击此处可查看英文原文。

quiverm

在基于 axesm 的地图上绘制二维箭头图

    说明

    quiverm(lat,lon,dlat,dlon) 在当前基于 axesm 的地图上创建一个箭头图。箭头图中,箭头具有方向分量 dlatdlon,其地理坐标由 latlon 指定。例如,第一条箭头起源于点 lat(1)lon(1),沿着 dlon(1) 方向水平延伸,并沿着 dlat(1) 方向垂直延伸。默认情况下,该函数会调整箭头长度,以确保它们不会重叠。

    示例

    quiverm(lat,lon,dlat,dlon,scale) 调整箭头的长度:

    • scale 为正数时,该函数会自动调整箭头的长度以避免重叠,随后按 scale 的倍数进行拉伸。例如,scale2 会使箭矢长度加倍,而 scale0.5 则会使箭矢长度减半。

    • scale"off"0(例如 quiverm(lat,lon,dlat,dlon,"off"))时,该函数不会执行自动缩放。

    quiverm(lat,lon,dlat,dlon,LineSpec) 指定线型、标记和颜色。标记出现在由 latlon 指定的位置。若使用 LineSpec 指定标记,该函数将不显示箭头。

    quiverm(lat,lon,dlat,dlon,LineSpec,"filled") 填充由 LineSpec 指定的标记。

    quiverm(lat,lon,dlat,dlon,LineSpec,scale,"filled") 调整箭头的长度,并填充由 LineSpec 指定的标记。

    h = quiverm(___) 返回箭头图,可使用前文语法中任意组合的输入参数。

    示例

    全部折叠

    将代表气流的样本数据加载到工作空间中,并选择该数据的子集。

    load("wind","x","y","u","v")
    lat = y(11:22,11:22,1);
    lon = x(11:22,11:22,1);
    dlat = v(11:22,11:22,1);
    dlon = u(11:22,11:22,1);

    创建地图并显示所选子集的箭头图。矩阵 latlon 表示每支箭的箭座位置,而 dlatdlon 则表示每支箭的方向分量。默认情况下,quiverm 函数会缩短箭头长度,以避免它们相互重叠。

    figure
    [latlim,lonlim] = geoquadline(lat,lon);
    usamap(latlim,lonlim)
    
    quiverm(lat,lon,dlat,dlon)

    Figure contains an axes object. The hidden axes object contains 11 objects of type patch, line, text.

    输入参数

    全部折叠

    箭头基点的纬度坐标,指定为标量、向量或矩阵。

    latlondlatdlon 的大小必须匹配。

    使用与基于 axesm 的映射中 AngleUnits 属性的单位相匹配的单位来指定此参数。

    数据类型: double

    箭头基点的经度坐标,指定为标量、向量或矩阵。

    latlondlatdlon 的大小必须匹配。

    使用与基于 axesm 的映射中 AngleUnits 属性的单位相匹配的单位来指定此参数。

    数据类型: double

    箭头的纬度分量,指定为标量、向量或矩阵。

    latlondlatdlon 的大小必须匹配。

    使用与基于 axesm 的映射中 AngleUnits 属性的单位相匹配的单位来指定此参数。

    数据类型: single | double

    箭头的经度分量,指定为标量、向量或矩阵。

    latlondlatdlon 的大小必须匹配。

    使用与基于 axesm 的映射中 AngleUnits 属性的单位相匹配的单位来指定此参数。

    数据类型: single | double

    线型、标记和颜色,指定为包含符号的字符向量或字符串标量。符号可以按任何顺序显示。您不需要指定所有三个特征(线型、标记和颜色)。

    若使用 LineSpec 指定标记,则 quiverm 函数不会显示箭头。

    示例: "--or" 是一条带圆形标记的红色虚线

    线型描述生成的线条
    "-"实线

    Sample of solid line

    "--"虚线

    Sample of dashed line

    ":"点线

    Sample of dotted line

    "-."虚线

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

    标记描述生成的标记
    "o"圆圈

    Sample of circle marker

    "+"加号

    Sample of plus sign marker

    "*"星号

    Sample of asterisk marker

    "."

    Sample of point marker

    "x"叉号

    Sample of cross marker

    "_"水平线

    Sample of horizontal line marker

    "|"垂直线

    Sample of vertical line marker

    "square"方形

    Sample of square marker

    "diamond"菱形

    Sample of diamond marker

    "^"上三角

    Sample of upward-pointing triangle marker

    "v"下三角

    Sample of downward-pointing triangle marker

    ">"右三角

    Sample of right-pointing triangle marker

    "<"左三角

    Sample of left-pointing triangle marker

    "pentagram"五角形

    Sample of pentagram marker

    "hexagram"六角形

    Sample of hexagram marker

    颜色名称简称RGB 三元组外观
    "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

    箭头缩放因子,指定为非负标量或 "off"。默认情况下,quiverm 函数会自动调整箭头的比例,以避免它们相互重叠。quiverm 函数在自动缩放箭头后应用指定的缩放因子。

    要关闭自动缩放功能,请将 scale 指定为 "off"0。当指定上述任一值时,该函数将绘制从 (lat, lon) 到 (lat+dlat, lon+dlon) 的箭头。

    输出参量

    全部折叠

    箭头图,以 Line 对象向量形式返回。

    版本历史记录

    在 R2006a 之前推出

    另请参阅

    函数