LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Portion of wave in different colour

Solved!
Go to solution

Hi Everyone ,

 

Hope everyone is doing good. I have a small problem , I am detecting valleies and peaks of waves , i want the portion which is peak or valley to be in different colour so that user can see them clearly.

 

I am using waveform graph . I am attaching a picture , in it i have circled the part which i want to be in different colour.

 

can anyone help ?

 

Rgs

 

Omar

0 Kudos
Message 1 of 8
(3,684 Views)

For each portion of a plot that you desire a unique color you will have to use an unique trace for each portion. The portions of the trace that should not be shown use "NaN" to tell LV to "lift the pen" when drawing that portion.

 

The extra traces can be added below the rest of your plots and the legend sized to hide those extra plots.

 

There should be some examples of this found under tags "GUI tricks" or something similar.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 8
(3,674 Views)

No picture attached.

 

But you can do the following, use two graphs, with two colors, in the first graph you replace the data in the peak with 'NaN' values, the second graph you replace the data outside the peak with NaN values.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 8
(3,672 Views)

Sorry , here is the picture

 

can anyone attach an example (the example should be in .vi not  a png because i use 8.6 and it doesn't supports pngs) . or can anyone direct me to  an example ..

 

Thanks for the helpp

0 Kudos
Message 4 of 8
(3,665 Views)
Solution
Accepted by topic author OmarTariq

The answer was given above.  Here it is in picture and VI form (version 8.6.1), alternately coloring the cycles of a sine wave.

 

DifferentGraphColors.png

 

This method has the disadvantage of requiring a full data set for every color you want to plot.  Alternately, you can break your waveform into different pieces and plot them as separate plots, making sure you set the timestamps correctly.  To make this work, you will need to set the graph so it uses timestamps.  Right click the graph plot area and unselect Ignore Time Stamp.  This will put your X-axis into time formatting.  Right click the X-axis and select Formatting....  Pick the formatting you want and you should be good.

0 Kudos
Message 5 of 8
(3,624 Views)

Thanx guyss 😃

0 Kudos
Message 6 of 8
(3,615 Views)

see also here.

 

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 8
(3,612 Views)

thanx ben 😃

0 Kudos
Message 8 of 8
(3,610 Views)