Using the index values to do the math does get exact numbers. Hopefully, this works for you!
I'm reading this post two months later, with some of the same needs. But in my case I want to use an array that I already possess, to set up the color ramp for my 3-D graph. But can you explain to me what the index numbers mean? I downloaded and looked at the example you gave. But what does an index value of 255 mean in reference to a color table of six colors? Or a Z axis that ranges from 0 to 10? Is 255 just the universal size of a color ramp?
OK, I think I found the answer to my last question. 255 is indeed the automatic size of the color table, and color indexes are given in reference to that number.
But now I have another question: supposing that my color scale ranges from dark blue to light green, II would like to tell the graph is that dark blue refers to a Z value of -2 (or anything less), while light green refers to a Z value of +3 (or anything greater). I can use property nodes to do that to the Z scale itself, but the colors seem to autoscale independently in some way that I don't understand. Is there any way to override the autoscaling of the colors?
The color mapping depends on your input. You cannot fix the Z value to a certain color. That's a feature missed. If your input's min-Z is -2 and max-Z is +3, then it matches.