11-18-2011 03:21 AM
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 🙂
11-18-2011 05:08 AM
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...
11-18-2011 05:30 AM
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.
11-18-2011 06:02 AM
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...