필터 지우기
필터 지우기

Changing 'FaceAlpha' on a Patch changes the plot

조회 수: 3 (최근 30일)
Chris
Chris 2012년 11월 1일
I was trying to highlight certain periods during a day by putting a semi-transparent patch in the background of the plot, and noticed that adjusting the FaceAlpha property in the patch from '1' changes the whole plot. Specifically I noticed that the edges of the patch no longer matching the specified edges in the patch command, also the colors of other lines are changed.
Anyone know why this is, or what to do to fix it.
Here's an example:
>> x = datenum(now-1):1/1440:now;
>> y = sin(x*10);
>> figure;plot(x,y)
>> patch([now-.75 now-.25 now-.25 now-.75],[.4 .4 .6 .6],'r')
>> chil = get(gca,'Children');
Produces a sinusodal plot with a small red patch.
>> set(chil(1),'FaceAlpha',.1)
Causes the line to become very digitized
>> set(chil(1),'FaceAlpha',1)
Returns it to normal.

답변 (1개)

Sean de Wolski
Sean de Wolski 2012년 11월 1일
This is probably because the 'Renderer' was not OpenGL before you set the transparency. Since OpenGL is the only renderer that supports transparency, it switches to this and causes other things to look slightly different.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by