LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot scatter data with density-based color in LabVIEW?

I want to plot a scatter graph in LabVIEW where the color of the points reflects the local data density; for example, regions with more overlapping points appear brighter (like a heatmap), and sparse regions appear darker.

How can I achieve this in LabVIEW?

Is there a way to color points based on density or overlay an XY scatter plot on top of a density plot (Intensity Graph)?

0 Kudos
Message 1 of 14
(518 Views)

Calculate a picture and display it using picture control. 

 

Alternatively use .net control with some opengl.

Actor Framework
0 Kudos
Message 2 of 14
(498 Views)

This sounds like the Intensity Chart and Intensity Graph, which you can find on the Front Panel "Graph" Palette.  I've never used these, so won't offer any advice other than to check out the Examples that ship with LabVIEW.

 

Bob Schor

0 Kudos
Message 3 of 14
(477 Views)

@sonisatyam wrote:

Is there a way to color points based on density or overlay an XY scatter plot on top of a density plot (Intensity Graph)?


So you already have an intensity graph that contains your data as a 2D array (x(i), y(j), z=count quantized to the grid defined by x0,dx and y0,dy, etc.). If your data is scattered (i.e. many point of the intensity graph have missing values, you could probably convolute it with a 2D Gaussian for example to get a smooth heat map.

I don't understand what you want to "overlay". Can you show an example picture (e.g. from a different program) of what you are trying to achieve?

Can you attach some typical data?

0 Kudos
Message 4 of 14
(466 Views)

sonisatyam_0-1754247698671.png

This is the type of plot I want on my front panel as a scatter plot

0 Kudos
Message 5 of 14
(446 Views)

Just create a 2D array of sufficient resolution and map you data into it, the display in an intensity graph.

Create a suitable color ramp for the z axis.

 

Is the colored island some surface fit to a model?

 

Again, can you attach some typical data and also maybe show a picture that has a bit more resolution and also tell us what the color code means?

0 Kudos
Message 6 of 14
(438 Views)

I don't have any data yet, above screenshot was from a research paper describing the prototype I'm building. It shows a pulse signal, where each peak corresponds to a passing droplet. I need to plot peak amplitude versus peak width, and the plot should highlight areas of data point accumulation by increasing their brightness or color. This visualization will help in setting threshold values using cursors.

(Instead of plotting each point as a simple marker, my interface brightens the color or increases the intensity where many points accumulate.)

0 Kudos
Message 7 of 14
(427 Views)

Here's a simple example how you can basically a 2D historgram (normalized count vs. x&y)

 

(In this case we simulate Box-Muller pairs quantized to the 2D array grid..

 

altenbach_0-1754253580098.png

 

altenbach_2-1754254934506.png

 

 

 

0 Kudos
Message 8 of 14
(415 Views)

Just for fun. The same image, but after 500M iterations (about 0.119 ms per iteration, i.e. it took 16 hours and 28 minutes):

D_mitriy_0-1754379617176.png

 

 

Message 9 of 14
(361 Views)

@D_mitriy  ha scritto:

Just for fun. The same image, but after 500M iterations (about 0.119 ms per iteration, i.e. it took 16 hours and 28 minutes):

 


It took that long because you probably redrew the graph every iteration. If you move it outside the loop it takes me about 40 seconds to do 500M iterations:

Basjong53_0-1754381769058.png

Basjong53_1-1754381805519.png

 

 

0 Kudos
Message 10 of 14
(347 Views)