Code covered by the BSD License  

Highlights from

5.0 | 3 ratings Rate this file 55 Downloads (last 30 days) File Size: 833 KB File ID: #47314
image thumbnail



Chad Greene (view profile)


22 Jul 2014 (Updated )

Plot georeferenced vector fields with color options.

| Watch this File

File Information

quivermc is an adapted version of Andrew Roberts' ncquiverref. Dr. Roberts' function and this function fix a couple of problems with Matlab's quiverm function. The two primary reasons you should never use quiverm are as follows:
1. Matlab's quiverm confoundingly mixes up u and v. By convention in the Earth sciences, u is the zonal component where eastward is positive and v is the meridional component where northward is positive. Matlab gets this wrong, but the quivermc function described here gets it right.

2. For reasons related to ship travel and some old legacy code from Navy guys decades ago, Matlab's quiverm scales vectors in a strange way that depends on latitude. If you're plotting some absolute field like wind vectors, there is no physical reason that you would want to scale vectors in such a way that their zonal components shrink to zero at the poles.

In addition to fixing the problems described above, quivermc also allows a few extra options including color settings, arrow density, and options for displaying converging or diverging flow.


Quiverc, Quiverc2, Quiverc2wcmap, Quiverc, Quiverc.M Updated With New Features, Quiverwcolorbar, Ncquiverref, and Calcticks inspired this file.

This file inspired Antarctic Mapping Tools and Circlem.

Required Products Mapping Toolbox
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
15 Dec 2014 Ehsan Sadighrad

Thanks, this is excellent.

21 Aug 2014 Chad Greene

Chad Greene (view profile)

Leyon, that is an excellent suggestion. I've now included some options for colorbars. Thanks for the tip!

Comment only
15 Aug 2014 Leyon

Leyon (view profile)

Very nice function. A suggestion to improve your function is to scale the colorbar xticks based on the reference value rather than 0:1. It would eliminate the need for the user to do the multiplication.
Here is the snippet of code I use to do such a task:

set(cb, 'xticklabel', get(cb, 'xtick') * refval);

cb is a handle to the colorbar or in your case can be turned on if the option colormap is defined in line 331.

06 Aug 2014 Chad Greene

Chad Greene (view profile)

Not to be confused with this guy:

Comment only
29 Jul 2014 Warwick

Good quiver plot function with excellent range of options.

24 Jul 2014

Removed 'refvec' 'on' or 'off' style. Now a reference vector is printed only when units are declared.

29 Jul 2014

Now includes linewidth option and more arrow size scaling options.

21 Aug 2014

Now includes options for colorbar formatting, made possible in part by John Barber's calcticks function.

22 Aug 2014

Typo fix in example file.

Contact us