MATLAB: Create a specular colormap

colorbarcolormapMATLABpatchsurf

I'm using the patch function with a "hot" colormap.
However, I'd like the colormap to be specular; namely I'd like it to be centered on zero and have the same color for positive and negative values with the same absolute value.
Is it possible to do it?

Best Answer

figure; imagesc( rand(100) - 0.5 ); % Random data centred on 0
baseCmap = hot( 256 );
cmap = [ flip( baseCmap(2:end,:) ); baseCmap ];
colormap( cmap )
caxis( [-0.5 0.5] )