MATLAB: Does using PATCH with transparency cause the axes to disappear in MATLAB

axesdisappearMATLABopenglpatchtransparency

If I use the following code, the X axis disappears when transparency is used :
t = linspace(0,2*pi,128);
y1 = 5*cos(t);
y2= 10*sin(t);
plot(t,y1,'b')
hold on
area(y2,t)
alpha(0.5)
If I do not create a line plot, then the Y axis disappears:
t = linspace(0,2*pi,128);
y2= 10*sin(t);
area(y2,t)
alpha(0.5)

Best Answer

This has been verified as a bug in MATLAB 6.5 (R13) and later versions in the way that axes are rendered in hardware accelerated OpenGL, when transparency is used.
There are currently no known fixes to the bug itself, but there are a couple workarounds.
1. Set the OpenGL renderer to use software acceleration instead of the hardware acceleration.
opengl software
The disadvantage of this method is that with resource intensive figures, software acceleration may be slower compared to hardware acceleration. Please refer to the OpenGL renderer documentation for more info.
2. Update graphics card drivers or try a different graphics card. Older driver versions may or may not work. A solution is not guaranteed.