n.l.o wrote:
> Im a bit confused of how I should use the "quiver" plotting function.
> 
> My data is 2D, a 512x512 data array, where every entry is an angle
> (polarimetry).
> I also have an array with the degree of polarization which would be nice to
> colour-code in to the arrows.
> So:
> How do I use my angles to control the direction of the arrows, and how do I
> get values to control the colour of the arrows?
> 
> Cheers,
> Magnus
> 

Example with ipython -pylab:

x = arange(4)
y = arange(5)
X, Y = meshgrid(x, y)
u = ones_like(X)
v = zeros_like(X)
c = arange(u.size)  # values mapped to colors
angles = (X * 20 + Y * 20).ravel()
quiver(X, Y, u, v, c, angles=angles)
axis([-1, 4, -1, 5])


The .ravel() of the angles is to get around a bug that I fixed a few 
minutes ago in svn.

Eric


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to