Python matplotlib barbs/quiver map colors to different sets of values
===

I am trying to create a barb vector plot in matplotlib and map some colors to specific magnitudes: for example, to have vectors with magnitudes between 10 and 20 plotted as blue, and between 20 and 30 as rgb(0,15,40), and so on. The documentation for the barbs and quiver functions (they are similar) mentions the C input arg:

-----------------------------------------------------------------------------
barb(X, Y, U, V, C, **kw)

Arguments:

X, Y:
The x and y coordinates of the barb locations (default is head of barb; see pivot kwarg)

U, V:
Give the x and y components of the barb shaft

C:
An optional array used to map colors to the barbs

------------------------------------------------------------------------------

However, this is very vague, and after searching all over Google, I am no closer to understanding how to use this color array in specific ways. I managed to discover that by setting C equal to the array of vector magnitudes and specifying the "cmap" kwarg, it will map the barbs to the specified colormap, as in the example code below. However, this is not what I want. I want to control the colors of specific groups of magnitudes. Any help would be appreciated.

Example code:

    from matplotlib import pyplot as plt
    from numpy import arange,meshgrid,sqrt

    u,v = arange(-50,51,10),arange(-50,51,10)
    u,v = meshgrid(u,v)
    x,y = u,v
    C = sqrt(u**2 + v**2)
    plt.barbs(x,y,u,v,C,cmap=plt.cm.jet)
    plt.show()

Resulting plot image link: (sorry can't post images directly yet)

http://i49.tinypic.com/xombmc.jpg