title: Jupyter matplotlib plot does not respond to setting xlim or to modifications to x-axis labels
body: <p>I am new to Juptyer and to matplotlib, so I'm struggling to adjust the x-axis range on my plots.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>plt.figure(1)
  
  l_dt = dt[dt['datatype'] == 2.0]
  if len(l_dt['time'].values) &gt; 1:
      plt.subplot(223)
      plt.scatter(l_dt['time'].values, l_dt['measurementvalue'].values)
      plt.yscale('linear')
      plt.title('Carbs (g)')
      plt.grid(True)
  
  l_dt = dt[dt['datatype'] == 3.0]
  if len(l_dt['time'].values) &gt; 1:
      plt.subplot(224)
      plt.scatter(l_dt['time'].values, l_dt['measurementvalue'].values)
      plt.yscale('linear')
      plt.title('Activity (mins)')
      plt.grid(True)
  
  
  plt.tight_layout()
  plt.xlim(min(dt['time']), max(dt['time']))
  plt.show()
  
  print(min(dt['time']))
  print(min(dt['time']))
  </code></pre>
  
  <p>Here's my output:</p>
  
  <p><a href="https://i.stack.imgur.com/xaLIO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xaLIO.png" alt="output"></a></p>
  
  <p>As you can see, even though my log statement shows a min date in April 25 and a max date of May 9, I am seeing my axes in one case go all the way back to March despite this line in the code:</p>
  
  <pre><code>plt.figure(1)
  plt.xlim(min(dt['time']), max(dt['time']))
  </code></pre>
  
  <p>Here's what I've tried</p>
  
  <ul>
  <li>I tried moving the <code>xlim</code> line to before plotting, but this has not changed the behavior.</li>
  <li>I tried moving the 'xlim' line just before each <code>plt.subplot</code></li>
  </ul>
  
  <p>Thanks for any suggestions.</p>