LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing colour of my curve

Hello dear community of Labview ,

 

I am a newbie in LabVIEW and am face to a problem. I request your helps please .

 

I have created a state machine and in the sinus state, I want to change the colour of my curve for each relaunch of the sinus state. Do you know how to do that? I am thinkink about 2-3 weeks ago with any solutions 

 

Thank you in advance for your answers! 

 

Ngoc-Vinh Truong

0 Kudos
Message 1 of 10
(4,062 Views)

Hi Ngoc-Vinh,

 

I want to change the colour of my curve for each relaunch of the sinus state.

Do you want to change the color of the full plot (1) or do you want to see several sine waves in different colors (2)?

1: set the color of the plot using a property node of the XY graph

2: create an array of plots and assign a different color to each plot

 

Item 2 becomes easy once you get rid of the BuildXYGraph-ExpressVI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(4,049 Views)

The plot color is a property of the graph. Right-click on the XY-Graph terminal, click on Create -> Property, then navigate downward in the properties list until you find Plot -> Plot Color. Right click on the property node and select Change to Write.

Now you can connect a constant to the property node and see what happens. As you want to change the colour every time, you need to select or generate it automatically. In the Graphics&Sound -> Picture Functions palette, you can find useful functions.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 10
(4,047 Views)

I want to see several curves in differents colors (2). I have already worked on it (see attachement) but I have a bug on my main program so I prefer to downgrade my program to the easy way ( build XY)

 

Do you have an idea to change the color with the function "build XY" ?

0 Kudos
Message 4 of 10
(4,036 Views)

Pincpanter,

 

I have already think about this solution but I do not know how it works. I try to connect the property node to a constant but the curve does not change color 

0 Kudos
Message 5 of 10
(4,032 Views)

Hi vinh,

 

I try to connect the property node to a constant but the curve does not change color 

It will not change the color when you wire a constant…

 

In your case the problem are the plot properties you have set for the plot: make the plot legend visible and change the plot properties to show a line between the point. The line will use the color of your color constant!

 

On the other VI: you reall yshould not use ExpressVI functions (like JoinSignal) and DDT wires in such a VI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(4,025 Views)

So what do you advice me to do ?

Because I do not understand what do you mean by : 

"create an array of plots and assign a different color to each plot"

 

Do you mean by creating a shift register and creating a array? 

After that step,  I do not follow you by assigning a different color to each plot ( How do you wire that ?)

Sorry, I am lost ...

 

Sincerely,

 

Ngoc-Vinh Truong

0 Kudos
Message 7 of 10
(4,006 Views)

This is how you do it.Graph Example.png

Tim
GHSP
0 Kudos
Message 8 of 10
(3,997 Views)

Thank you for your answer but I do not think you , it will help me. 

I write that I am in the sinus state but in this state, I do not use sine wave, I have used function random number 0 to 1 and the index ( refer to my Vi)

 

Do you have another answer to give me please ? 

 

Thank you 

0 Kudos
Message 9 of 10
(3,975 Views)

My example showed you how to do what you need to do. You need to replace the sine wave generator and add what you need to do. I was not trying to solve your problem that is your homework. I simply showed you how to achieve your goal. You still need to figure out a few things on your own.

Tim
GHSP
0 Kudos
Message 10 of 10
(3,966 Views)