MATLAB: Can I specify a particular matrix for the colorbar

colormapmappingmatrices

I'd like to create a map using one particular matrix of data (log-transformed), but make the colorbar from a different matrix data (un-transformed). Is this possible? Can I specify for the colorbar to pull info from a matrix that wasn't used for the map?

Best Answer

No, the colorbar represents the colormap in use. For example you can't show a grayscale colorbar while having the image use the "jet" pseudocolor lookup table/colormap. Though you can redefine what the tick marks say. And you can put up an image the same size as the colorbar right where it would go and display any RGB image in there you'd like (for example a colorbar that looks like what you want rather than the color map that is actually being used on the image being displayed.)