I'm having an infuriating issue with XY Graphs which I can't figure out how to fix - I have an XY graph which plots two arrays every second or so. Checkboxes on the front panel allow the user to select which array/s are plotted.
When the VI is started Plot1 and Plot2 are white-on-black, as I have set them. If I uncheck a box, and only one is plotted, and then re-check the box, so both are plotted once again, Plot2 is now red-on-black. No amount of changing Plot2 back to white in the Graph properties seems to fix this - somehow the "default color" for Plot2 has been changed to red.
Why is LabView using red as the default color, and how can I change it permanently back to white?
Solved! Go to Solution.
It probably would be easier to always plot both traces and change the visibility of each trace as needed.
(You can even just display the visibility checkbox in the legend, no code needed at all!)
What is the datatype of the arrays? Yes, please show us some simplified code that demonstrates the problem.
Thanks for your replies - These are just arrays of floats. The VI is hard to get at because it's on a non-networked computer on restricted security. I'll look into a simple VI to replicate the issue, but I agree that toggling the visibility of the plots makes more sense.
I should be able to test this today.
IIRC, if you actually remove a plot, its properties disappear with it. If you want to maintain the properties of a plot, you need to do as Altenbach suggests and plot at least one NaN value (to effectively empty the display) or simply set the visibility to False (Recommended).
Thanks again - I was able to use a combination of plotting NaN values and toggling plot visibility to get the behavior I wanted. I had to learn how "active plot" property nodes worked.
It does seem to be the case that plotting>not plotting>plotting again resets the plot's properties.