Re: streamline plot with stUseScalarArray = True

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 5 Sep 2007 09:04:28 -0600 (MDT)

Hi Radovan,

Sorry for the late response. We had a burst of consulting activity
yesterday. I guess everybody came back from vacation and had
immediate software questions. :-)

Anyway, you can't color streamlines according to another field like
you can with vectors. So, how about instead using curly vectors, and
then coloring according to a third field that way? The functions to
use are Ngl.vector_scalar, or Ngl.vector_scalar_map if you want to do
this over a map.

We have some examples of this. Go to:

and look at examples ngl03p and ngl06p, and vector_pop. These examples
don't have curly vectors, but this can easily be remedied by setting
the "vcGlyphStyle" resource to "CurlyVector". (See on
the same page for an example of curly vectors.)

Let me know if this is not the solution you were hoping for.


On Tue, 4 Sep 2007, radovan bast wrote:

> dear all,
> first, please let me thank the pyngl/ncl developers for their great work!
> i would like to plot a streamline plot where the coloring
> uses a scalar data array.
> for instance i manage to plot the streamline plot with:
> plot = Ngl.streamline(wks, u_array, v_array, resources)
> and now i would like to color the streamlines according to one vector
> component (i.e. the v_array) or another 2d array
> i understand that i must specify:
> resources.stMonoLineColor = False
> resources.stUseScalarArray = True
> but how can i specify how/which scalar data array has to be used for the
> coloring?
> since i don't i get:
> warning:StreamlinePlotInitialize: No scalar data: using streamline magnitude
> for levelsa
> and pyngl colors according to the norm of the vector
> the manual indicates: the resource stScalarFieldData is [to be] set with a
> valid ScalarField object
> i don't know how this can be done in practice and i would be very grateful
> for every hint.
> best greetings,
> radovan
> _______________________________________________
> pyngl-talk mailing list
pyngl-talk mailing list
Received on Wed Sep 05 2007 - 09:04:28 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 05 2007 - 09:07:02 MDT