フィルターのクリア

Two different colormaps overlaying

1 回表示 (過去 30 日間)
Fiona Gong
Fiona Gong 2019 年 10 月 7 日
コメント済み: Fiona Gong 2019 年 10 月 7 日
Hi
I've got an anatomical image 192*192 and a binary ROI with same size. I'd like to display them in one figure but with different colormaps, here's the code I use but it only shows ax2 and no idea why... any help much appreciated!
% read in image IM size 192*192
ax1 = axes;
A = imagesc(IM);
% read in mask m 192*192
ax2 = axes;
B = imagesc(m);
linkaxes([ax1,ax2]);
ax2.Visible = 'off';
ax2.XTick = [];
ax2.YTick = [];
colormap(ax1,'gray');
colormap(ax2,'hot');

採用された回答

Walter Roberson
Walter Roberson 2019 年 10 月 7 日
You did not put the axes in different positions: axes() with no Position parameter puts the axes in the default position.
You also did not make the second axes background color 'none' so that objects below would show through.
You also did not make the second image transparent at all, so it will cover over all of the first image.
  1 件のコメント
Fiona Gong
Fiona Gong 2019 年 10 月 7 日
Thanks very much yes position adjusted now. Both my images are same size with background value 0, hence transparent won't work. Is there a way to make all 0s transparent in both ax?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBlue についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by