From: Wu Zhiyong on
Hi Mikael,
Could you explain how you make it work more?
I have a plot of line/marker and patch.
When I tried to make the patch transparent (the code below), the markers are also transparent.

for i=1:length( x)
h(i)=patch([repmat( x{i}(1),1,2) repmat( x{i}(2),1,2)], ...
[get(gca,'YLim') fliplr(get(gca,'YLim'))], ...
[0 0 0 0],colors{i});
set(h(i),'FaceAlpha',alphas{i});
end;

I ploted the line/marker first, set the handles off as suggested by pipa, then added the patch and made it transparent. But it doesn't work as the markers turned to be transparent, too.

Much appreciate!

Zhiyong

"Mikael Henriksson" <tf05mh3(a)student.lth.se> wrote in message <hnr95k$mvp$1(a)fred.mathworks.com>...
> Walter, I think you are right about there being some inconsistency with the renderer. I tried rendering with eps and it worked.
>
> Thanks
>
> Walter Roberson <roberson(a)hushmail.com> wrote in message <hnr6a5$2n3$1(a)canopus.cc.umanitoba.ca>...
> > Mikael Henriksson wrote:
> > > "Fredrik " <fredrik.hedberg(a)noonday.com> wrote in message
> > > <hnqsih$a8d$1(a)fred.mathworks.com>...
> >
> > >> I'm trying to plot a transparent histogram on top of my original plot,
> > >> which works just fine (see code below). Unfortunately, when I plot
> > >> squares on top of that, they are also transparent, which I do not want.
> >
> > >> h=bar(xout, yout, 'w');
> > >> hPatch = findobj(h,'Type','patch');
> > >> set(hPatch,'facealpha',0.4);
> > >> plot(x,y,'s','MarkerEdgeColor','black',...
> > >> 'MarkerFaceColor','white',...
> > >> 'MarkerSize',6);
> >
> > > I have somewhat the same problem. And have been looking around for
> > > answers, unsuccessfully. Look at the post; "Possible
> > > Transparency/Clipping Glitch?" for a similar problem.
> >
> > If you are using transparency, then you must be using the OpenGL renderer. One
> > property of the OpenGL renderer is that when two objects lie in the same
> > plane, then the order that they are rendered is dependent upon the type of
> > object, not upon the order you created the objects in. OpenGL mandates a
> > particular order of rendering in this case, but I have seen systems that do
> > the rendering in the opposite order of other systems, so I do not count on the
> > specification.
> >
> > If what I describe is the problem you are running into (the clipping problem
> > is a different problem), then the solution is to move either the patch or the
> > plots out of the Z=0 plane, leaving the objects you want on top "closer" to
> > the viewer.