‎10-31-2012 08:57 AM
I have a vi written in 7.1 that has three traces in one plot. I have selector radio buttons so the user can turn on or off any channel. The problem is the color of the trace is automatically grabbed by the vi and chooses the colors based on which trace is turned on first, second and third. So, if the user turns off all of the channels and then turns them on one at a time, from top to bottom, they are correct, green, blue, and then red. But, if they turn them on from the bottom first, then the first and third traces no longer follow the plot color legend. Basically, I want to know how to lock a plot color to a given channel.
Regards,
Ron
Solved! Go to Solution.
‎10-31-2012 09:45 AM
I can't vouch for 7.1, but you are looking at plot.color property node similar to the one in this example. http://digital.ni.com/public.nsf/allkb/C6BFD9BD5F01108C86256F8100638B29
‎10-31-2012 10:11 AM
Likewise I don't know if this property exists in LabVIEW 7.1, but at least in newer LabVIEW versions there is a plot visible property which you can use to hide plots without changing the colors.
‎10-31-2012 10:19 AM
nathand,
That one sounds like it will work. The only question is, will the colors still change to the active plot? That is my problem. Once I turn off two plots and then turn on just one, it changes colors.
‎10-31-2012 10:33 AM
In recent versions of LabVIEW, the visible property sets only whether or not the plot is shown on the graph. All other properties (such as color) remain unchanged regardless of whether or not the plot is visible, so you can hide or show plots with no effect on any other plot. I don't know if this was the case in LabVIEW 7.1.
‎10-31-2012 10:34 AM
Thanks, I'll try it!
‎10-31-2012 10:49 AM
No go.
The problem is that LabVIEW looks at the first plot, no matter what channel it is and automatically colors it blue. The second trace is red and the third trace is green.
‎10-31-2012 10:50 AM
Maybe I should have been clearer... are you only adding the data to the plot that you want to show? In order for the visible plot approach to work, you need to plot all the data, and let LabVIEW take care of hiding the channels that you don't want shown.
‎10-31-2012 10:55 AM
Yes. I have a triax accelerometer which measures horizontal, vertical and axial vibration. All three go to one plot representing the vibration in all three directions at that bearing. I have the cursor block set up for three cursors, one for each direction. I have toggles set up to turn on or off any or all of these three inputs. I have the cursors initially locked, one to each direction that is labeled in the cursor block. There are also colors chosen for each direction. The problem, as soon as I turn off any channel, the two channels still on display automatically change to the default colors for 2 traces, first one blue, second one green, no longer matching my plot color legend.
‎10-31-2012 10:57 AM - edited ‎10-31-2012 11:00 AM
I am losing the plot here! I was thinking this would have done the job!