title: Display y axis from 0 to 100 in Matplotlib plot
body: <p>I wanted to display my data and wanted to set the y axis to show always from 0 to 100 or from 10 to 60.</p>
  
  <p>I used "set_ylim()" and it worked with a small list but then I tried to put my data in that had datetime as x and a int as y and this didn't worked or the list is too long.</p>
  
  <p>the data list looks like this: [ [ ] , [ ] , [ ] ]
  and the first list has datetime.datetime()
  the second is an int that mostly has 20,22 and 21 repeating and the third looks similiar to the second.</p>
  
  <p>using the small list with set_ylim: <a href="https://i.imgur.com/TinN6pT.png" rel="nofollow noreferrer">https://i.imgur.com/TinN6pT.png</a></p>
  
  <p>with my data and set_ylim: <a href="https://i.imgur.com/uWPCYy6.png" rel="nofollow noreferrer">https://i.imgur.com/uWPCYy6.png</a></p>
  
  <p>with my data working without set_ylim: <a href="https://i.imgur.com/wh4wPwp.png" rel="nofollow noreferrer">https://i.imgur.com/wh4wPwp.png</a></p>
  
  <pre><code>import matplotlib.pyplot as plt
  import matplotlib.animation as anim
  import matplotlib.dates as mdates
  import numpy
  import time
  import datetime
  
  #####read data####
  data = ([datetime.datetime(2020, 5, 15, 7, 33, 35), 
          datetime.datetime(2020, 5, 15, 7, 33, 37), 
          datetime.datetime(2020, 5, 15, 7, 33, 39), 
          datetime.datetime(2020, 5, 15, 7, 33, 41), 
          datetime.datetime(2020, 5, 15, 7, 33, 43), 
          datetime.datetime(2020, 5, 15, 7, 33, 45)], 
  
          ['20', '20', '22', '20', '20', '22'], 
  
          ['30', '32', '31', '30', '32', '31'])
  ##################
  
  #####plot data#####
  fig = plt.figure()
  #axis1#
  ax1=fig.add_subplot(211)
  
  #axis2#
  ax2=fig.add_subplot(212)
  
  
  def update(i):
  
      #readData(data)
  
      ax1.clear()
      ax2.clear()
  
      ax1.set_ylim((10,60))
      ax2.set_ylim((0,100))
  
      #ax1.plot([1,2], [20,30])
      #ax2.plot([2,3],[2,3])
      ax1.plot(data[0],data[1],color="red")
      ax2.plot(data[0],data[2],color="blue")
  
      #tweak style#
      ax1.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M'))
      ax2.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M'))
  
  ###################
  
  a = anim.FuncAnimation(fig,update,repeat=False)
  plt.show()
  </code></pre>