LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3d Graph Custom Colorbar

Solved!
Go to solution

Please refer to the attached VI. Here is the block diagram. I would mention that I converted the outputs 

x and y as, right click them -> Choose data type -> 1D Array of Real
Same for z except that 2D Array of Real was chosen.

block.png 

Here is the code used in MATLAB script, in case someone is unable to open the attached VI owing to version issues:

x = linspace(-a,a,50);
y = linspace(-b,b,50);

for i = 1 : length(x) 
    for j = 1: length(y) 

        z1(i,j) = 1 - (x(i)^2/a^2) - (y(j)^2/b^2);        
       
        if z1(i,j) < 0
            z(i,j) = 0;
        end

        if z1(i,j) >= 0
            z(i,j) = 10*(z1(i,j))^0.5;
        end

    end
end

Here is the output of this vi:

Front.png

What I want is something like this:

Wish.png

Any ideas? What am I doing wrong? Or what can be done to achieve the desired result using the given conditions? I am also attaching an MWE (Minimum working example) using mathscript to facilitate the direct and to the point answers as much as possible. I would highly appreciate if someone could not only edit the attached VI for desired results but also explain the concept behind a little.

0 Kudos
Message 1 of 5
(3,864 Views)
Solution
Accepted by topic author Unknown_Mist

Right click, select "3D Plot properties" (not simply properties), then Surface tab, there is Color map style selection.

Message 2 of 5
(3,814 Views)

Wish.png

Hello, I did as told by you. But I can't change any colors here. How to do so?

0 Kudos
Message 3 of 5
(3,810 Views)

Hello, It worked perfecgtly now. Thanks I got it. I had to right click the numeric markers to change the colors.

0 Kudos
Message 4 of 5
(3,804 Views)

Hello, I have a little bit different question on the same topic. 
Is it possible to programmatically control the color bar marker values.

 

For eg, in this plot, can I control the values of these (black arrow) markers?
Screenshot 2022-10-20 163139.png

0 Kudos
Message 5 of 5
(1,189 Views)