[ncl-talk] Color vectors by angle not amplitude

David Brown dbrown at ucar.edu
Fri Aug 14 15:31:04 MDT 2015


Hi Maria,
There is no function that automatically colors vectors based on the
angle, but you can color the vectors based on an arbitrary scalar
field using gsn_csm_vector_scalar_map or several related functions
(see http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_csm_vector_scalar_map.shtml).

And you can easily compute the angle based on the u and v values using
atan2 (http://www.ncl.ucar.edu/Document/Functions/Built-in/atan2.shtml).
This doc has examples of converting u and v to the scalar field
"meterological wind direction".
 -dave


On Fri, Aug 14, 2015 at 2:53 PM, Maria Gehne - NOAA Affiliate
<maria.gehne at noaa.gov> wrote:
> Hi all,
>
> has anybody tried to set the color of vectors in a vector plot by the angle?
> It's easy to the set the color based on the amplitude of the vector, but
> there is no built-in function that colors vectors by angle. (I think!
> Correct me if I'm wrong.) I would still like to have changing amplitude of
> the vectors, but the colors associated with the vectors should be dependent
> on angle not amplitude.
>
> This way the small amplitude vectors would not be as visible, but the colors
> of the angles with the large amplitudes would be.
>
> Thanks,
> Maria
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


More information about the ncl-talk mailing list