フィルターのクリア

Changing 'FaceAlpha' on a Patch changes the plot

2 ビュー (過去 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 Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by