title: Hatch a plot in MATLAB
body: <p>I use this code in order to generate a graph:</p>
  
  <p>And I must to hatch everything outside the square.</p>
  
  <pre><code>pos = [3.75 5.6 53.5 29.5];  %spatiul nemasurat
  axis([0 61 0 45]) %axele
  set(gca,'YTickLabel',{'0', '7.5','11.85', '16.2', '20.55', '24.9', '29.25', '33.6', '39.3', '45'})
  
  rectangle('Position',pos,'EdgeColor','black')
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/LnAp5.png" alt="Figure"></p>