Display NaNs values and apply alphadata for values different to NaNs

3 ビュー (過去 30 日間)
Haythem Zouabi
Haythem Zouabi 2020 年 11 月 11 日
コメント済み: Haythem Zouabi 2020 年 11 月 12 日
Hello,
I want to display the NaN values by setting an alphadata equal to 0 and at the same time apply an alphadata equal to 0.3 for values different to NaNs?
This is the code i use but it doesn't work:
im=imagesc(I)
set(im,'AlphaData',0.3);
set(im,'AlphaData',~isnan(I))
Thanks,

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 11 日
Try this
im = imagesc(I);
im.AlphaData = 0.3*ones(size(I));
im.AlphaData(isnan(I)) = 0;
  1 件のコメント
Haythem Zouabi
Haythem Zouabi 2020 年 11 月 12 日
Hello,
I need to resize and define the position of the colorbar.
This is my code:
ax3 = subplot(2,3,2);
ibg2 = imagesc(scene);
axis off
hold on
iim2 = imagesc(im,'XData',[16 466],'YData',[104 484]);
caxis([0 3])
iim2.AlphaData = 0.75*ones(size(im));
iim2.AlphaData(isnan(im)) = 0;
colorbar
colormap parula
caxis([0 3])
cb = colorbar;
set(cb,'position',[.10 .1 .1 .1])
This is the graph i get :
I need to place the color bar in the blue box (see figure)?
Thanks,

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by