LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3D Plot Color Ramp - Colors to Values

Solved!
Go to solution

Hi all,

 

The Color Ramp for 3D plots only displays 3 values; not all values for every displayed color is shown (see below).

 

Default Color Ramp.jpg

 

The actual values associated with each color is available via the 3D Plot Properties dialog (during edit).

 

3D Scatter Plot Properties Dialog.jpg

 

Color Ramp Editor.jpg

 

How can I access the values for these colors programmatically such that I can display them to the user?

 

Thanks,

 

Battler.

0 Kudos
Message 1 of 16
(6,519 Views)

For most color ramps, you can simple right click on them and choose "Add Marker" to add additional displayed values. You can then change values to move the marker to where you wish.

 

However, I've been unable to verify this for the "Color Ramp for 3d Plot" because I can't seem to locate that particular front panel object. What pallete are you getting it from? Is it part of a toolkit?

 

If you post your VI, I'd be willing to play around with it a little and see what I can figure out for you.

0 Kudos
Message 2 of 16
(6,499 Views)

Sorry, not sure why I couldn't find the plot you're talking about yesterday - found it this morning just fine. I don't think the functionality you want is available. The best workaround I can figure out right now is to use the plot property node Plot Specific>Surface>Surface Color Ramp. If you write this to an indicator, it shows up like this

3dplot.png

 

You can move through numbers on the Color Ramp Array to see what color is associated with each index. If the colors are evenly distributed as they are in the picture in your post, you could determine the number associated with that color. For example, here index 3 is green. There are indexes 0-6 and 3/6*10=5 which is about the number you have for green in the above post. I know this is a super sketchy workaround, but I don't think there's a propery that does what you want. 

 

Another option with this propery node would be to make it a control, use a custom scale, and have the user define the colors for each index. Then they know what colors are where.

0 Kudos
Message 3 of 16
(6,484 Views)

@Alisha P wrote:

 

You can move through numbers on the Color Ramp Array to see what color is associated with each index. If the colors are evenly distributed as they are in the picture in your post, you could determine the number associated with that color. For example, here index 3 is green. There are indexes 0-6 and 3/6*10=5 which is about the number you have for green in the above post. I know this is a super sketchy workaround, but I don't think there's a propery that does what you want. 

 


 

Hi Alisha,

 

The index values do not match the values.  I have worked this out and checked against the values given in the plot properties dialog; they don't match.

 

Message 4 of 16
(6,476 Views)

You're right that they don't match the values exactly. It also is completely dependent on how the values are set for your particular color ramp, especially whether or not they are evenly spaced. In your first post, you showed a picture with the colors distributed according to the default. The method I mentioned in the previous post gets pretty close to these values (really a little under each of them - has to do with how the default is distributed).

 

You're also right that this isn't a very good solution. It's a work around to a functionality that I don't think exists. There are probably better work around options - that's just what I came up with.

0 Kudos
Message 5 of 16
(6,471 Views)

@Alisha P wrote:

You're right that they don't match the values exactly. It also is completely dependent on how the values are set for your particular color ramp, especially whether or not they are evenly spaced. In your first post, you showed a picture with the colors distributed according to the default. The method I mentioned in the previous post gets pretty close to these values (really a little under each of them - has to do with how the default is distributed).

 

You're also right that this isn't a very good solution. It's a work around to a functionality that I don't think exists. There are probably better work around options - that's just what I came up with.


 

One question please Alisha.

 

Are we to accept your work-around as the best answer NI can offer?

 

I would think a CAR is called for to ensure R&D is at the very least aware of the issue.

 

A little concerned this will get swept under the rug,


Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 16
(6,466 Views)

Hi,

 

Here's slightly prettier version of what I was saying earlier. If you unbundle the cluster read from the property node that I mentioned earlier and do the math using the "Ramp Index Values" rather than the "Ramp Array Values" you get more accurate numbers that aren't dependent on spacing. The unbundling also allows you to make it prettier on your front panel. Hopefully, this is a more acceptable work-around.

 

As far as reporting this to R&D, there is no unexpected behavior here. If you would like to request the specific functionality you are looking for, you can request it on ni.com/ideas.

 

Thanks!

0 Kudos
Message 7 of 16
(6,457 Views)

Realized I didn't attach the VI - sorry.

0 Kudos
Message 8 of 16
(6,452 Views)

I have actually pilfered the Color Ramp Editor that is launched from the Property Page for my own use (adapted for intensity graphs).  In fact, I like the clever use of a hidden Intensity Graph in the editor.  You can find the Editor at the following location:

 

\vi.lib\Math Plots\3D Math Plots\3D Plot\3D Plot\Protected\Property Page\Color Editor.vi

 

It took a few minutes to de-OOP it and make my own copy, but that was about it.

0 Kudos
Message 9 of 16
(6,449 Views)

Alisha,

 

I would be happy (although it would be a good new feature) to implement this work-around.

 

However,

 

The values must match exactly (give or take rounding errors of course).  An approximate "solution" is not acceptable; not really a solution.  Infact if the values don't match exactly then I wonder whether the values are related at all.

 

Thanks,

 

Battler.

0 Kudos
Message 10 of 16
(6,441 Views)