Changing 'FaceAlpha' on a Patch changes the plot
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Sean de Wolski
il 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 Commenti
Vedere anche
Categorie
Scopri di più su Surface and Mesh Plots in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!