LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fill just a portion of a XY graph

Hello all,

 

I would like to know if somebody here knows how to fill just a portion on the XY graphs, I'm plotting the displacement versus force and also calculating the area under the curve. The area is defined by two cursors (X1 and X2), what I would like to do is to fill only that portion of the graph (between X1 and X2) not all the plot, I used the fill to option and it fill all the plot completed. PLease take a look on the attached picture for a better reference

Thanks for your help!

 

0 Kudos
Message 1 of 18
(3,579 Views)

Create a second plot with the same data, but remove the out of range data or replace it with NaN. Create the fill on the second plot only.

Message 2 of 18
(3,557 Views)
I would double check the NaN + fill combination, I do not remember it ending well.
0 Kudos
Message 3 of 18
(3,547 Views)

Please check this example. It is done using 500 random numbers by creating a supplementary waveform and replacing there with NAN 100 points in the beginning and 100 points at the end.  I hope this is what you want.

0 Kudos
Message 4 of 18
(3,518 Views)

Sorry I forgot the attachment.

0 Kudos
Message 5 of 18
(3,514 Views)

Fill to NaN appears to work, except perhaps for some tiny graphical glitches on the y=0 pixel row.

 

partial_fill.jpg

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 6 of 18
(3,510 Views)

I hope the attachment will be visible now.

0 Kudos
Message 7 of 18
(3,492 Views)

@Thoric wrote:

Fill to NaN appears to work, except perhaps for some tiny graphical glitches on the y=0 pixel row.

 


Set the y minimum <0 to see the origin of those now not-so-tiny graphical glitches.

0 Kudos
Message 8 of 18
(3,469 Views)

Hello Nicku thanks a lot for your help, but unfortunately I cannot see the file you just attached Smiley Sad

can you upload it on labview version 8.5 or lower, that will help for sure

 

thank you!

0 Kudos
Message 9 of 18
(3,465 Views)

Hello altenbach I saw you are a very active and trusted member of this forum, I need to say that I got understand your suggestion making a second plot with the specific section, but what is not so clear to me is the usage of the NaN, I'm not familiarized with that constant and would like to know how it works, can you help explaining that with a sample?

 

Thank you very much for your advice!

 

I will appreciate your response

0 Kudos
Message 10 of 18
(3,464 Views)