Be the first to rate this file! 40 Downloads (last 30 days) File Size: 6.25 KB File ID: #40224
image thumbnail

quiverwcolorbar

by Melissa Day

 

11 Feb 2013 (Updated 14 Feb 2013)

Generates a quiver plot colored according to vector magnitude and/or user specified axis boundaries.

| Watch this File

File Information
Description

quiverwcolorbar adds functionality to the original quiver function by assigning color to the arrows according to the vector magnitude. The corresponding colorbar spans the minimum and maximum values of the dataset or can be specified by the user. Any changes to the colorbar boundaries change the vector colors accordingly.

   Syntax:
      quiverwcolorbar(x,y,u,v,scale,'bounds',[colormin colormax])

   Inputs:
      x, y: Vector locations
      u, v: Vector directions (East-West, North-South)
      scale: Scalar value to set vector lengths
      'bounds': Optional setting to specify colorbar axis minimum and maximum values

   Example:
      x = rand(1,50).*100;
      y = rand(1,50).*100;
      u = rand(1,50) .* 10;
      v = rand(1,50) .* 10;
      scale = 0;
      figure; quiverc2wcmap(x',y',u',v',scale); %compare to:
      figure; quiverc2wcmap(x',y',u',v',scale,'bounds',[0 10]);

Acknowledgements

Quiver2.M V1.2 (Nov 2009), Quiverc, Quiverc2wcmap, and Vfield Color inspired this file.

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File  
Everyone's Tags
arrows, color, data, graphics, magnitude, plot, quiver, vector, velocity
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
24 Apr 2013 Melissa Day

FYI to everyone, I had a similar problem with http://www.mathworks.com/matlabcentral/fileexchange/7180-quiverc2wcmap and had to add "view([0,-90]);" after I called the plot for it to look right (after doing a clear all), so if anyone is having trouble with this maybe playing with the view will help.

17 Apr 2013 Travis Miles

For some reason this is flipping my y-axis and image from increasing to decreasing...

Updates
12 Feb 2013

Fixed some typos, added bit in case min(xyuvvrNNs) < colormin

12 Feb 2013

changed spacing in description

14 Feb 2013

Fixed some typos, added bit in case min(xyuvvrNNs) < colormin

Contact us