Display NaNs values and apply alphadata for values different to NaNs

7 visualizzazioni (ultimi 30 giorni)
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,

Risposta accettata

Ameer Hamza
Ameer Hamza il 11 Nov 2020
Try this
im = imagesc(I);
im.AlphaData = 0.3*ones(size(I));
im.AlphaData(isnan(I)) = 0;
  1 Commento
Haythem Zouabi
Haythem Zouabi il 12 Nov 2020
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,

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Colormaps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by