comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Histogram question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Histogram question [message #40379] Sat, 07 August 2004 21:11
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
I have some data I need to histogram. I have two vectors, v1 and v2
which define a two-dimensional density. Normally I could just use
HIST_2D and and I'd be set. However, this time around I have a third
array, v3. v3[i] corresponds to a distinct number of counts at the
position [v1[i], v2[i]]. So, when I do the histogram, I want to use the
value found in v3 rather than just simply calculating a density based
only on occurrences of v1 and v2 pairs.

For example, let's say that I have...
v1 = [0, 1, 0, 2, 0, 2, 2, 1, 0]
v2 = [1, 1, 2, 2, 0, 1, 2, 0, 0]
v3 = [3, 0, 2, 0, 1, 1, 4, 2, 1]

Doing a HIST_2D against v1 and v2 should yield something like...
[[2, 1, 0],
[1, 1, 1],
[1, 0, 2]]

But what I really want would use the counts in v3 instead of
incrementing by 1 for each occurrence of [v1[i], v2[i]]...

[[2, 2, 0],
[3, 0, 1],
[2, 0, 4]]

Anyone know of an efficient way to do this? I figure there's some trick
you can do with histogram to achieve this effect, but I am no where near
the histogram guru like others on this list.

-Mike
[Message index]
 
Read Message
Previous Topic: Re: How do I morph an image.
Next Topic: Re: IDL on Windows vs. Unix, debugging consideration

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 15:20:38 PDT 2025

Total time taken to generate the page: 1.58141 seconds