LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

plot 2D arrays on graph

I have a 3D array and I need to plot its content. The 3D array contains many hundreds of matrixes. I want to plot each data point of each matrix so that I get hundreds of curves on one graph.

What is the most efficient way to do that?

 

 

0 Kudos
Message 1 of 10
(5,838 Views)

There's a difference between efficiency and practicality in terms of visual determination and comprehension. I, for one, would be bewildered at seeing "hundreds of curves", whether they're on a 2D or 3D plot. You should consider paring down that number or at least providing the user with the ability to pick what to see.

 

0 Kudos
Message 2 of 10
(5,826 Views)

Hi,

 

I formulated it incorrectly. So I need to display exactly 64 curves on one graph and the point of this is only to have a short look whether all the sensors in the array behave/react in the same way.This way I can clearly and instantly see if there is a sensor not working  [the 3D array contains the matrixes that contain the measurement results].

0 Kudos
Message 3 of 10
(5,817 Views)

OK, so what are you having problems with? How to graph, or that there's too much data? If there's too much data then you should decimate the data before sending it to the graph. Attached are a couple of VIs that I picked up somewhere that make it easy to decimate data for a graph. The decimation is based on the display width of the graph along with a picture of typical usage. The graph in the example is an XY graph, but the same concept with work with a waveform graph.

0 Kudos
Message 4 of 10
(5,804 Views)

 


@krivan wrote:

I have a 3D array and I need to plot its content. The 3D array contains many hundreds of matrixes. I want to plot each data point of each matrix so that I get hundreds of curves on one graph.


 

A matrix is typically a 2D array, and to visualize all elements of a 2D array you need an intensity graph. There are no "curves" per se (unless only a small subset of adjacent points along an arbitrary line contain real data, for example.)

 

Please tell us exactly how your 2D array looks like, how the data is arranged, and what you want to graph. Easiest would be if you could attach a simple VI that contains a typical example of your 3D data an a diagram constant. Thanks!

0 Kudos
Message 5 of 10
(5,798 Views)

I attached the VI I am having problem with and the tdms_index file of the read tdms file.

 

So the tdms file  that I am reading contains at the moment four pieces of 64x64x1000 large 3D arrays. The reading happens as follows: I take a group [which contains a 3D array] from the file and start reading its 64x64 matrixes. I select the predefined element of the actual 2D array, I store the actual data point in an array [shift register, insert into array] then at the end of the reading this array goes to the waveform graph. This is how I plot the results of one sensor.

 

Now the problem is that for the previously discussed reason I want to plot the results of all sensors, so all elements of the 3D array should be plotted in one waveform graph.

I think that would be certainly possible if I repeated the dataflow above 64x64 times however it would be computationally very expensive and inefficient in case of having for example 1000 pieces of 3D array that can happen if the data acquisition goes for days. 

 

The attached VI shows that I can read the results of one sensor, it's no problem. Where I tried to wire the 2D array directly into the waveform graph is the problematic part.

 

Thanks for both of you,

Krivan

 

P.s.: Just to be exactly clear, the data acquisition and the application is described here.

Download All
0 Kudos
Message 6 of 10
(5,789 Views)

Can I have some advice regarding this topic please.

 

Thanks,

Krivan

0 Kudos
Message 7 of 10
(5,758 Views)

All programming aside, I still have a hard time imagining how a graph of 64x64x1000 point should look like on the screen. This is twice as many points as pixels on a 1080p display. Clearly, there is no way to show all that information at once.

 

Can you sketch out what you have in mind?

0 Kudos
Message 8 of 10
(5,755 Views)

So I have this 3D array that contains many 2D arrays inside. If I want to plot one curve - the behaviour of one sensor - I auto-index the 3D array and going through the third dimension by a for-loop I always take the same element from each 2D array that belongs to this sensor. This way I get a 1D array at the end that is possible to plot in a waveform graph.

 

Now if I want to do the same with all the elements it would require 4096 of such procedures I just described. It would require to much resources. I thought of indexing the 3D array anding send every single 2D array one-by-one into the waveform graph so that the graph gets updated every time and I get 64 curves at the end.

0 Kudos
Message 9 of 10
(5,750 Views)

But a 2D array is not a curve here, it represents a plane. You could create a movie by indexing out each plane at regular intervals while displaying each plane in an intensity graph in rapid succession.

0 Kudos
Message 10 of 10
(5,733 Views)