title: Multiple y axis with same x axes in matplotlib
body: <p>Hello I have several values to plot into a graph that share the same x axis (time) but multiple y values(temperature, umidity etc), I did this code. I can't get the y axis scale in the right and in a good form(now there are overlapping y scale, so you can't really see what values you have for each value). I want a graph that share the same axis but the y bars are in the right and you can understand the values of it, so the problems are the y bars that are not well shown. How can I fix it? This is the problem <a href="https://i.imgur.com/G1EiYIh.png" rel="nofollow noreferrer">https://i.imgur.com/G1EiYIh.png</a> as you can see the y bar are not in a good form, one is overlapped too </p>
  
  <pre><code>import serial
  import time
  import matplotlib.pyplot as plt
  import numpy as np
  from drawnow import *
  arduinoData = serial.Serial('/dev/ttyACM0',9600)
  time.sleep(2)
  data_temperature = []                       # empty list to store the data
  data_luminosity = []
  data_thermistor = []
  data_umidity = []
  plt.ion()
  counter = 0
  def makePlot():
  
      plt.ylim(15,35)
      plt.title('Real Time Data')
      plt.grid(True)
      plt.ylabel('Temperature')
      plt.plot(data_temperature, 'ro-', label = 'Temperature')
      plt.tick_params(direction='right')
      plt.legend(loc='upper left')
      plt2 = plt.twinx()
  
      plt2.plot(data_umidity, 'bo-', label = 'Umidity %')
      plt2.legend(loc= 'upper right')
      plt3 = plt.twinx()
      plt3.plot(data_thermistor, 'go-', label = 'Thermistor temperature')
      plt3.legend(loc = 'lower left')
  
  
  while True:
      if arduinoData.inWaiting()==0:
          pass
      time.sleep(5)
      arduinoString = arduinoData.readline()         # read a byte string
      arrayData = arduinoString.split()
      luminosity = float(arrayData[0])
      thermistorTemperature = float(arrayData[1])
      temperature = float(arrayData[2])
      umidity = float(arrayData[3])
      print(luminosity, thermistorTemperature, temperature, umidity)
      data_temperature.append(temperature)
      data_luminosity.append(luminosity)
      data_thermistor.append(thermistorTemperature)
      data_umidity.append(umidity)
      drawnow(makePlot)
      plt.pause(.000001)
      counter += 1
      if counter &gt; 50:
          data_temperature.pop(0)
          data_umidity.pop(0)
  
  
  ser.close()
  
  </code></pre>