Changing 'FaceAlpha' on a Patch changes the plot
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
0 commentaires
Réponses (1)
Sean de Wolski
le 1 Nov 2012
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.
0 commentaires
Voir également
Catégories
En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!