ncquiverref

版本 1.6.0.0 (13.2 KB) 作者: Andrew Roberts
Quiver (vector) with a reference vector or color code on a map or Cartesian axes.
8.5K 次下载
更新时间 2015/2/23

查看许可证

This function is a substitute for the standard versions of quiver and quiverm available using a vanilla release of matlab. This version assumes a 2D vector field is being plotted using a gridded flow field from a numerical model. It is primarily intended for Earth System Model analysis.
The function enables the scaling of vectors according to a reference vector plotted in the lower right hand corner of the plot axes. The function works for both map and Cartesian axes and allows the color of vectors to be changed.

If a reference value is not provided, the reference value is calculated by rounding the median or maximum magnitude of the quiver vectors. Scaling of vectors still occurs even if the reference vector plotting is switched off. This enables different subplots to share identical scaling so that the relative magnitude of vectors can be compared between subplots (provided they share the same grid).

The function also includes the ability to plot color vectors, all of equal length but color coded according to their magnitude. In this case, a colorbar is provided, complete with units, and no scaling vector is plotted.

Vectors are centered on the grid points they represent, rather than the tail of the arrow being positioned on the grid point as is the case for the vanila Matlab quiver and quiverm versions.

引用格式

Andrew Roberts (2024). ncquiverref (https://www.mathworks.com/matlabcentral/fileexchange/17582-ncquiverref), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2014b
兼容任何版本
平台兼容性
Windows macOS Linux
致谢

启发作品: 2D Vector Field Visualization, quivermc

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.6.0.0

This update includes fixes the colorbar to enable the function to work with graphics changes in R2014b.

1.5.0.0

Removed use of the Latex interpreter to avoid a bug in MATLAB R2010b. The Latex text interpreter may cause Matlab to crash when using the 'nodisplay' option (this bug has been reported to Mathworks).

1.4.0.0

Fixed a bug that occurred when calculating the median vector magnitude when most of the field has vectors of zero length.

1.3.0.0

This file has been amended so that meshgrid does not need to be run prior to using the function. Also, a small bug has been fixed to allow the use of axis ij to invert the y axis for non-color plots.

1.2.0.0

This function is a complete rewrite of the originally submitted file.

1.1.0.0

This is a complete rewrite of the originally posted function. Vectors are generated within this function rather than using quiver and quiverm, are now centered on the grid points, and have the ability to be color coded according to their magnitude.

1.0.0.0