In Matlab I'm plotting a matrix (let's call it M) using imagesc over an image using imshow. I would like M to have a degree of transparency so I can actually see the image below. This is what I'm doing:
imshow(img); hold on;
h = imagesc(M);
set(h,'AlphaData',0.4); % set transparency to 40%
However, the last line generates an error when running it on Linux. I've been trying to solve it but nothing seems to work. I wonder if there is an alternative to the "AlphaData" property to make it transparent. Thanks!
EDIT: I'm using Matlab R2014a and Java 1.7 on a Linux CentOS 6.6
get(gcf,'renderer')
return? (This will tell you the current renderer). Andset(gcf,'renderer')
? (This is the list of possible renderers). Try setting the renderer to one different than the one you are currently using. Some renderers don't support transparency. (On Windows, I think only'opengl'
does) – Luis Mendoalpha(.4)
or evenset(h, 'alpha',.5);
? – Iman