From:
Chris Pelkie <[EMAIL PROTECTED]>
Date: July 24, 2004 9:30:13 AM EDT
To: [email protected]
Subject: Fwd: [opendx-users] Coloring points based on one component of a vector


D'oh, wrong email address used the first time.

Begin forwarded message:

From: Chris Pelkie <[EMAIL PROTECTED]>
Date: July 23, 2004 5:29:40 PM EDT
To: [email protected]
Subject: Re: [opendx-users] Coloring points based on one component of a vector

For this particular problem, I'd do it like this:
reorganize things so that positions are [x,y] = [old 1d position, first component of vector]
at each of these new positions have 'data' be 'second component of vector'.

So, take your field to 2 Extracts, one "positions", one "data".
Send both these Extract outputs to a Compute, wherein you put [a.0, b.0] as expression.
a.0 removes the first and only component of the 1-vector position, making it scalar, then combined with b.0 and the brackets, returns a 2-vector. If you don't extract the scalar, you'll get a matrix which won't work.

In parallel, send Extract("data") (a second output from the same module as above) to a 2nd Compute, expression [a.1] to fetch the 2nd component of the vector, as scalar.

Now, run the 1st Compute to the 1st input of Construct, and the 2nd Compute to the 4th input of the
same Construct. This works since both arrays are still of the same length and still indexed to the same implicit indices.

Send Construct output through Colormap and Color (see samples for proper wiring), then Glyph with Autoaxes will give a basic scatter plot like thing. (or investigate Plot, which I don't care for).

<x-tad-bigger>____________________
Chris Pelkie
Managing Partner
Practical Video LLC
30 West Meadow Drive
Ithaca, NY 14850</x-tad-bigger>


On Jul 23, 2004, at 3:29 PM, John R. Cary wrote:

I will try to make this more specific. I have a 2-vector
field that is a function of a single variable. (I have
gotten to this point through reductions using compute.)
I want to make a scatter plot of the first component of
the 2-vector versus the position, but with the dots colored
according to the second component of the 2-vector.

My first attempt was to take one Compute module to extract
the first component, which I ran into a Color. I used a
second Compute module to extract the second component, put
it into a Colormap, and run that into the Color input for
"color", but this does not work.

Thanks.....John Cary


On Fri, 23 Jul 2004, John R. Cary wrote:

I have a 4-vector on an irregular set of points. (A collection
of particles with 3 velocities and one internal variable
that are at irregular positions in space.) I can
easily do the various scatter plot projections that I need
with all points black. However, I would like to be able to
have the point colored depending on the value of the extra
internal variable.

Can this be done with OpenDX? Any hints on getting started?

Thanks.....John Cary



--
John R. Cary
Professor, Dept. of Physics, University of Colorado, Boulder, CO 80309-0390
[EMAIL PROTECTED]
ph. (303) 492-1489 fax (303) 492-0642 cell (720) 839-5997





Reply via email to