LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Coloring a 3D Line Graph with absolute colormap mode

Hello,

 

I am trying to figure out how to add color to a 3D Line Graph whose colormap mode is "Absolute". In my vector of colors "Color vector", I only store the value 30, whic according to my colormap "Surface Color Map", should correspond to the green color and give me a green line on my 3D Line Graph. However, I get a line whose color change at each iteration of the while loop. Can someone explain me what is going on and how to have the values of the color vector matching those of the colormap ? (I can't use the "Relative Mode" while adding an element for the minimum and one for the maximum I want for my color, because it would create outliers on the plot)

Best regards !

 

         Blahodatne

Blahodatne_0-1779199977859.pngBlahodatne_1-1779200098074.png

 

 

 

0 Kudos
Message 1 of 5
(252 Views)

You probably want to fix some serious code problems first.

 

  • Why initialize with an array of 10 zeroes if you later just insert at [i]?
  • The upper shift register value should be blue, and is indentical to the value from the iteration terminal and thus not needed.
  • There is no need to built an array of one element before inserting.
  • "Built array" would be the correct function here, not "insert into array".
  • Your lower shift register is not initialized and will start with size=0 on the first run and whatever the array was on later runs. unpredictable.
  • etc. etc.
0 Kudos
Message 2 of 5
(228 Views)

Hello, 

 

Thanks for your corrections and excuse me for the mistakes (that can seem trivial,I am new to Labview).

Here is an updated version of my VI, hopefully with all the structural LabVIEW incoherences corrected, but with the same problem diagnosed. 

Best regards, 

 

      Blahodatne

0 Kudos
Message 3 of 5
(180 Views)

The "color vector" is an index into the colour map. You were giving it a value of 30 each time, which corresponds to black in your colour map.

If you leave colour vector completely disconnected I believe it operates based on the Z value by default which will give you the same output as below (which is still operating on Z since X=Y=Z="color vector" in this example).

 

 

 

deceased_0-1779270116892.png

 

deceased_1-1779270380249.png

 

 

0 Kudos
Message 4 of 5
(168 Views)

Hello deceased, 

 

Thanks for your answer. I tried to let the colour vector disconnected and it worked exactly as you predicted : the colour was following the values of the Z vector.

However, when I put a constant value in the color vector and connect it to the 3D graph, I have get a line whose color varies from black to purple then to blue and to green, with a color that seems to corresponds to two times the last value in the Z vector. 

 

Blahodatne_0-1779279255462.png

On top for 200 iterations, 

Blahodatne_1-1779279336804.png

On top for 400 iterations, 

Blahodatne_2-1779279408955.png

and on top for 1200 iterations. 

I am also using Labview 20.0.1, maybe it is playing a role in what is happening ?

Best regards, 

 

      Blahodatne

0 Kudos
Message 5 of 5
(143 Views)