I am using surf function to create a 3D shaded surface plot. I also define a variable C which is a 3 dimensional matrix. So if my number of rows and columns in Z is 155*125, my dimension of C matrix is 155*125*3.. I fill the color matrix C with RGB colors depending upon my criteria. The problem is when I want to display colorbar in my plot, I still get the standard RGB colorbar instead of the color matrix defined by me.
How can I modify the colorbar properties, so that it shows the actual colour being used in the plot.