title: Python -matplotlib.pyplot : draw a pulse train
body: <p>I'm having Voltage and admittance data.<a href="https://i.stack.imgur.com/T2134.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T2134.png" alt="enter image description here"></a></p>
  
  <pre><code>time_voltage = {1000 :760 , 3000 : 660, 4000 : 580, 6000 : 510,
               7500 : 460,9000 : 430,12000 : 410,13500 : 380}
  </code></pre>
  
  <h1>calculated ==> current / voltage</h1>
  
  <pre><code>_time_admittance = {1000 :0.636842105 , 3000 : 0.660606061, 4000 : 0.586206897, 6000 : 0.596078431,7500 : 0.267391304,9000 : 0.262790698 ,12000 : 0.248780488,13500 :   0.25}
  </code></pre>
  
  <p>using above data , I need to plot a pulse train like below. But I'm not sure where to start. Can you point me to the right direction</p>
  
  <pre><code>sig = np.arange(15000)
  sig.fill(0)
  for time_at,voltage in time_voltage.items():
          sig[time_at] = voltage
          admittance = voltage - _time_admittance[time_at]
          sig[time_at + 100] = admittance
  
  sig1 = np.arange(15000)
  sig1.fill(0)
  
  for time_at,Admittance in _time_admittance.items():
          for index in xrange(100):
              sig1[time_at] = voltage
              sig1[time_at + index] = Admittance
  
  
  plt.grid = True 
  ax = plt.gca()
  ax.set_axis_bgcolor('black')
  ax.grid(True ,color= 'w')
  plt.plot(sig)
  plt.plot(sig1)
  plt.show()
  </code></pre>