LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with XY Graph plot color - not remaining set properly. LV2011

Solved!
Go to solution

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? 

0 Kudos
Message 1 of 6
(2,806 Views)

Please post your VI that is demonstrating this behavior so we can investigate.

0 Kudos
Message 2 of 6
(2,787 Views)
Solution
Accepted by VPI001

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.

Message 3 of 6
(2,781 Views)

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.

0 Kudos
Message 4 of 6
(2,755 Views)

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).

Message 5 of 6
(2,748 Views)

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.

0 Kudos
Message 6 of 6
(2,730 Views)