LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change plot color between cursors?

Solved!
Go to solution

I have been trying to figure this out, but to no avail.  Here is what I would like to do:

I use the cursors on an XY plot to read out the information only between the cursors for further data processing (done with property nodes and a basic sub-VI I wrote to print the array of points between the cursors).  This works great.  What I would like to do (i.e. my boss Smiley LOL) is to have the color of the line between the cursors change to a different color than the rest of the data trace.  I tried a few property node things but nothing worked.  Anyone have a suggestion (if this is even possible)?  Thanks in advance.  

0 Kudos
Message 1 of 4
(1,531 Views)
Solution
Accepted by topic author jdepalma

Since you have already retrieved the data of interest, the hard part is done.

 

You will now have to split the existing plot into two unique plots.

 

The first will have as many points as the full data set but all of the points that are not inbetween the cursors will be replaced with "NaN" so that they do not plot.

The second will be similar but the values of interest will be replaced by NaN.

When both are plotted using diffrent colors you will get what you want.

You may have ot fidle a bit at the edges if the boss wants it to look like the plot connects and keep in mind the first plot is "on top".

 

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 4
(1,518 Views)

Hi Ben, 

 

Thanks for your note; logically, what you said makes perfect sense.  As I am unfamiliar with splitting a plot, can you proivde some basic steps for doing this or a resource so that I can go take a look?  Thanks in advance.

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

Use the total length of your array to init two arrys of NAN that you put in two shift registers of a For loop.

Pas in the arry of your plot and compare the "i" terminal to decide if the current value goes in the "highlighted plot" or the other.

That compare controls a Case structure that does a "replace array subset" of either the "highlighted on other array.

After the For loop is done, you should have two arrays ready for you to plot as you did the original.

 

Try coding it up. Try out your code in "execution highlighting mode" (turn on the light bulb) and watch it go.

 

have fun!

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 4
(1,503 Views)