title: MATLAB - dynamically resize x-axis but not y-axis in plots?
body: <p>I am generating a plot in real-time. I shift the x-axis by 30 seconds, every 30 seconds. This is all well and good, but my y-axis is auto-resizing itself to smaller than previously. Take a look below:</p>
  
  <p><img src="https://i.stack.imgur.com/rGt48.png" alt="Plot before 30 second threshold - Y limits are [-1 1]"></p>
  
  <p>This is my data before we hit the 30 seconds and redraw the x-axis labels. I'm just plotting <code>±cos(t)</code> right now, so my Y limits are [-1 1].</p>
  
  <p><img src="https://i.stack.imgur.com/4E5wp.png" alt="After 30 second threshold -  Y limits are [-0.8 0.5]"></p>
  
  <p>After the 30 seconds, I shift the axes over to start watching the plot generate on the time interval [30 60]. Notice that my Y limits have rescaled to [-0.8 0.5]. As time increases, the limits go back to [-1 1]. But I would like to have continuity between the previous 30 second snapshot and the current snapshot in time, i.e., limits should be [-1 1] immediately after hit the 30 second threshold.</p>
  
  <p>Is there a way to keep the previous Y limits and still let them grow properly (i.e., if Y data goes over limits it'll resize appropriately, automatically)?</p>