Create a specular colormap

3 次查看(过去 30 天)
Maria445
Maria445 2019-3-15
编辑: Adam 2019-3-15
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?

采纳的回答

Adam
Adam 2019-3-15
编辑:Adam 2019-3-15
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] )

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Blue 的更多信息

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by