LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot area between two cursor in waveform graph

In waveform, I want to know the area between the cursor and the signal which is showing between the cursor. 

 

SUMANSAURAV_0-1649486777606.png

 

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

If you know the index locations of those cursors, I would create another waveform with data only at locations between the cursors and the rest of the data changed to NaN (this tells the graph not to plot).

 

Now this second waveform you created can be configured to use a filled plot.

 

Next, about the area under the curve, I believe you can use the math library to extract the area.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 4
(1,150 Views)

Your question is too ambiguous to give a precise answer, because a picture alone is not sufficient.

 

  • Is this a waveform graph or and xy graph, or something else?
  • What is the datatype (dynamic, waveform, 1D array, complex array, etc.)
  • What are the units of the x axis?
  • What do you mean by "area"? The integral under the curve? What are the units of the integral?
  • Is the data always positive?

Assuming it is a simple waveform graph and 1D DBL array, use the cursor index property (make sure the cursors are locked to the plot!) and integrate the subset between. To graph the data, duplicate the data and make a 2D array, but replace all data outside the cursors with NaN and set the plot style to "fill baseline to zero".

 

 

0 Kudos
Message 3 of 4
(1,140 Views)

@altenbach wrote:

Assuming it is a simple waveform graph and 1D DBL array, use the cursor index property (make sure the cursors are locked to the plot!) and integrate the subset between. To graph the data, duplicate the data and make a 2D array, but replace all data outside the cursors with NaN and set the plot style to "fill baseline to zero".

 

 


Here's how that could look like:

 

altenbach_0-1649519129750.png

 

You also need to decide to include or exclude the cursor positions for the area calculations, so modify as needed (i.e. define "between" exactly). Of course things only need to be recalculated when the data or cursor positions change, so use an event structure. You can use a cursor move or cursor release event to get the "CursIdx" of the moved cursor from an event data node. (Not shown)

 

Message 4 of 4
(1,133 Views)