title: Y-axis disappear when patch is see-through
body: <p>I'm trying to plot measurements with fitted line and predictor  bounds for several experiments to be compared and I use Matlab 2011b with Win7/64 bit.</p>
  
  <p>To do so, I fit the function <code>FitSt</code>, and get the fitting data for <code>feval</code> and <code>predint</code> functions.</p>
  
  <p>The problem occurs when I try to plot the predictor bounds with <code>patch</code> function and set <code>FaceAlpha</code> property to anything but 1 - the y-axis disappear. When the plot is panned, x-axis disappears as well but re-appears sometimes. When the <code>patch</code> object is deleted or the <code>FaceAlpha</code> is set to 1, the axes re-appear. Tick marks remain untouched.</p>
  
  <p>When such figure is exported (using <a href="http://www.mathworks.com/matlabcentral/fileexchange/23629-export-fig" rel="nofollow noreferrer"><code>export_fig</code></a>) to <code>pdf</code>, axes are visible but <code>patch</code> is opaque (I suppose <code>pdf</code> does not support opacity). When exported to <code>png</code>, the result is without axes but with opacity - exactly the same as matlab figure.</p>
  
  <p>Suppose we have data in vectors <code>Xm</code>, <code>Ym</code>, <code>Xf</code>and <code>Yf</code> and 2-column martices <code>Xp</code> and <code>Yp</code>. Second characted denotes Measurement, Fit and Predictor bounds, respectively. Then not-so-minimal working example is:</p>
  
  <pre><code>%% Plot measurement data      / Optional
  line('xdata',Xm,'ydata',Ym,'color','b','linestyle','none','marker','.')     
  
  %% Plot fit line              / Optional
  line('xdata',Xf,'ydata',Yf','color','b')
  
  %% Plot predictor bound patch / Mandatory
  pp=patch(Xp(:),Yp(:),zeros(length(Xp(:)),1),'facecolor','b','linestyle','none')
  
  %% Plot predictor bound edges / Mandatory
  Xp=[Xp;nan(1,2)];Yp=[Yp;nan(1,2)];
  line('xdata',Xp(:),'ydata',Yp(:),'color','b')
  
  %% Screw axes
  set(pp,'FaceAlpha',0.125)
  
  %% Unscrew axes
  set(pp,'FaceAlpha',1)
  </code></pre>
  
  <p>Ultimate MWE:</p>
  
  <pre><code>fill([0;0;1;1],[0;1;1;0],[0;0;0;0],'facealpha',.5)
  set(gca,'xlim',[-0.02 1.02],'ylim',[-0.02 1.02])
  </code></pre>
  
  <p><s>What is causing this strange behaviour and</s> how can one avoid it?</p>
  
  <p>Images created by whole code:
  <a href="https://i.stack.imgur.com/MaUtP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MaUtP.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/DaQ5u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DaQ5u.png" alt="enter image description here"></a></p>
  
  <p><strong>Edit</strong></p>
  
  <p>Same problem was discussed <a href="http://www.mathworks.com/matlabcentral/newsreader/view_thread/102250" rel="nofollow noreferrer">here</a> and the problem is caused by OpenGL renderer.</p>
  
  <p>When I "unscrew" the axes, te renderer switches automatically from <code>opengl</code> to <code>painters</code>. When I run <code>set(gcf,'renderer','opengl')</code>, I screw the nonscrewed axes. If I run <code>set(gcf,'renderer','painters')</code> I unscrew screwed axes but lose opacity.</p>