Code covered by the BSD License  

Highlights from
quivermc

5.0

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

quivermc

by

 

22 Jul 2014 (Updated )

Plot georeferenced vector fields with color options.

| Watch this File

File Information
Description

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.

Acknowledgements

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
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 (4)
21 Aug 2014 Chad Greene

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

15 Aug 2014 Leyon

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

Not to be confused with this guy: https://www.youtube.com/watch?v=ljB_q-XjSp4

29 Jul 2014 Warwick

Good quiver plot function with excellent range of options.

Updates
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