title: xaxis/yaxis lines in matlab plot
body: <p>couldn't find this: </p>
  
  <p>I would like to plot a line on X and Y axis that always fits to 100% to the width or height of the figure.</p>
  
  <pre><code>figure; hold on;
  plot(rand(1,100));
  line(xlim,[.5 .5],'Color','red');
  line([50 50],ylim,'Color','red');
  pause(.5)
  xlim([1 200]);% lines should now automatically extend
  </code></pre>
  
  <p>with <code>grid on</code> it's possible to get a grid that scales automatically, however it seems impossible to only limit the grid to the X/Y axes. Ideas?</p>
  
  <p><a href="https://i.stack.imgur.com/ZT4F4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZT4F4.png" alt="bsdf"></a></p>
  
  <p>after scaling:</p>
  
  <p><a href="https://i.stack.imgur.com/SjfEC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SjfEC.png" alt="asdf"></a></p>
  
  <p>what I would prefer:</p>
  
  <p><a href="https://i.stack.imgur.com/SdIxO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SdIxO.png" alt="enter image description here"></a></p>