Does the latest version of Matlab allow more than one colormaps in one plot?

2 次查看(过去 30 天)
In the past, overlaying two axes was the only option, but overlaying can often causes its own problems, e.g., slight offset, etc.
Does anyone know if Matlab has fixed the issue?
Many thanks.
  3 个评论

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2021-11-3
编辑:Image Analyst 2021-11-3
Nothing to fix. You can have only one colormap per axes control, but you can get around that by having basically two colormaps stacked on top of each other and adjust your data. For example if you have data that goes from 0 to 1023 (like a uint16 image) and want one colormap for gray levels 0-511 (say gray) and another (say, hsv) from 512 to 2013, you can do
cmap = [gray(512); hsv(512)]
imshow(yourImage, 'Colormap', cmap);

更多回答(0 个)

类别

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

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by