You can apply alpha only to the top level, e.g.
clf, contourf(peaks), hold on
[c,h] = contourf(repmat(0.25*(1:49)-5.25,49,1));
ch = get(h,'child'); alpha(ch,0.2)
Yuri
"Pete " <petem...@gmail.com> wrote in message <gae1uu$232$1...@fred.mathworks.com>...
z = peaks;
[c,h] = contourf(z); clabel(c,h), colorbar
% Set the figure Renderer to OpenGL, which supports transparency
set(gcf, 'Renderer', 'OpenGL');
% Find all the objects that are children of the contourgroup that have the
FaceAlpha property
alphable = findobj(h, '-property', 'FaceAlpha');
for k = [1:-0.1:0.1 0.1:0.1:1]
% Change the FaceAlpha property, which will change the objects'
transparency
set(alphable, 'FaceAlpha', k);
pause(0.5)
end
--
Steve Lord
sl...@mathworks.com
When I did this a while back I ran into a problem with
the colours of the semi-transparent contours appearing
incorrect (the wrong hue in some cases). This turned out
to be because the contour objects with the FaceAlpha
property were stacked on top of each other, so that when
they were made semi-transparent any object(s) below
would contribute to the final colour. In the end, I
used getframe to capture the opaque contourf plot and
then display the resulting image semi-transparently over
the background image.
I don't know if this problem applies to the current
version of MATLAB - you might want to check this if the
filled contour colours are important.
Francis