LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a 2D-histogram?

How can I create a 2D-histogram in labview?


Lets say my data consists of alot of data points (x,y) and I want to plot them in a xy-scatterplot like manner but I want the color to indicate the density/frequency of datapoints around this particular x,y coordinates. This would probably require some sort of 2D-binning. I would also like to retain x and y scales and the zoom functions thats available for the standard x,y scatterplot in labview.

 

What I want to do is something like this: http://www.davidbdean.com/2006/08/17/how-to-plot-a-2d-histogram-using-matlab/ but with alot more bins

 

Is there a standardized labview function to create such a plot?


Do I need an addon to the labview-core package to be able to use this?

 

I would be grateful for any help 🙂

0 Kudos
Message 1 of 4
(4,452 Views)

I am not aware of any builtin functions to do the 2D binning but it would be pretty trivial to create.  Try doing a modulo division of each point's x and y values by the increment between bins in the x and y direction respectively. The q outputs of the divisions will be the x and y values of the bin the point belongs in.  Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 4
(4,441 Views)

Yes, that is a good idea.

 

But how do I plot it afterwards?, I have tried the intensity plot but it has a few issues. The input is a huge 2D array where the coordinate corresponds to the x and y values and the number corresponds to the intensity or histogram count. In doing this, the unit/scale on X and Y axis are both lost and instead they are numbered 1,2,3,4,5,6,7 etc. which makes it hard to navigate the data.

 

Therefore, I was thinking that if labview had a prebuilt function for such a histogram or a 2D density plot of some sort this may be more useful.

0 Kudos
Message 3 of 4
(4,439 Views)

to recover the scaling simply multiply the x and  y values coming from the modulo division by the bin size along that axis and then add 1/2 the bin size.   Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 4
(4,433 Views)