LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with interpolation of color in 3D graph

Hi All,

 

Im using three colors for my 3D graph. When i have two points next to eachother, one at the highest value of the z-axis and one at the lowest, the interpolation is only working with two colors. See the attached pictures please. The right side of the graph has multiple points and the interpolation works properly. On the left side you can see that it skips the yellow color in the middle. Is there a way to also use the middle color for interpolation between two points without adding extra points in the z-matrix? I cant add extra points because sometimes I am working with very large matrices already. Thank you in advance.

 

Greetings,

 

Elias

Download All
0 Kudos
Message 1 of 11
(3,433 Views)

Hi OP11,

 

I'd like to help you with this, but I'm not really sure at the moment why the yellow colour is being skipped. I could try to find a way to add it in without adding extra points, but it would be easier for me if you could send over the VI you're using if this would be possible.

 

Thanks,

 

Cody

0 Kudos
Message 2 of 11
(3,357 Views)

It looks like you have only two points on the left side, one at minimum and one at maximum.  I would think it's an interpolation error where the interpolation is simply being done from the start to the final colour but without taking into consideration that there may be intermediate colours which are not represented by data points.

 

Try adding a data point around 8.00 on the left side and I bet your yellow will reappear.

0 Kudos
Message 3 of 11
(3,349 Views)

Hi Cody, 

 

Thank you for the reply. Unfortunately i cant send you the entire program, but i made a random matrix generator a while back which shows the problem perfectly. Hopefully this helps. Play a little with the controls and you should see what i mean. I added the file below.

 

Greetings,

 

Elias

 

edit: btw excuse me for the late reply,  i was on holidays

0 Kudos
Message 4 of 11
(3,262 Views)

Hi Intaris,

 

Thanks for the reply, if I do what you say indeed the yellow appears. But as stated before i cant use extra datapoints in my matrix, unfortunately. Take a look at the vi uploaded in Cody's reply if you'd like.

 

Greetings,

 

Elias

0 Kudos
Message 5 of 11
(3,255 Views)

Hi Elias,

 

Thank you for sending that VI, I opened the code you sent me, and changed the controls in a few different ways but I was unable to see the problem that you're seeing. Do any specific settings give you this result?

 

Cody

0 Kudos
Message 6 of 11
(3,234 Views)

Hi Cody,

 

If you put the matrix size to 4x4 or 5x5, and add no gradient, you usually have two points next to each other with one close to the max number, and one close to the min. I added a screenshot of this happening, you can see it on the right side of the 3d graph. The yellow color is skipped in the interpolation. Thanks again!

 

Elias

0 Kudos
Message 7 of 11
(3,207 Views)

I came across a very nice example just now which shows why this problem is important for me. I added a screenshot

0 Kudos
Message 8 of 11
(3,189 Views)

Hi Elias, 

 

I still see the yellow colour on the example VI you sent me even if I put the settings as you said. Is there any reason why you add no gradient, and do you still see no yellow colour if you do add a gradient? I'm not sure if it is possible to add in a colour without adding in a data point, is there any alternative method you would consider?

0 Kudos
Message 9 of 11
(3,175 Views)

Hi Cody,

 

The reason why I add no gradient is to display the problem. This VI was initially used for other purposes. If a gradient is used, there is less chance of having two datapoints next to eachother in the XY field while being the max and min numbers in the Z-matrix. So if I use gradients I do see the yellow color. Maybe that VI wasn't a good example to display my problem... Sorry for that. Anyway, did you look at the last screenshot I uploaded? That is one of a real measurement and you see that one outlier disrupts the interpolation. 

 

If there is an alternative method to adding extra datapoints I would consider it yes. The problem is I dont know any alternatives. I am already struggling with very large matrices, so adding in more points is really a 'no go'. Thanks again!

 

Elias

0 Kudos
Message 10 of 11
(3,169 Views)