title: Filling an area under curve until a x value
body: <p>I want to color the area below the curve until the x value = 3500 (the red y x constant) but I can't manage to doit. I tried with fillbetween() method but it didn't worked.</p>
  <p><a href="https://i.stack.imgur.com/xqz3L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xqz3L.png" alt="enter image description here" /></a></p>
  <p>This is my code for plotting</p>
  <pre><code># Se define toda la generación 
  G_T = sum([300,500,1000,400,1400,500,600])
  G = np.arange(-1,G_T,0.01) 
  P = [0,20,32,41,44,50,70,100] # Precios   
  P_y = np.zeros((G.shape[0]))
  
  # Vector de precios
  P_y[(G&gt;=0) &amp; (G&lt;=300)] = P[1]  
  P_y[(G&gt;300) &amp; (G&lt;=800)] = P[2] 
  P_y[(G&gt;800) &amp; (G&lt;=1800)] = P[3]
  P_y[(G&gt;1800) &amp; (G&lt;=2200)] = P[4] 
  P_y[(G&gt;2200) &amp; (G&lt;=3600)] = P[5]
  P_y[(G&gt;3600) &amp; (G&lt;=4100)] = P[6]
  P_y[(G&gt;4100) &amp; (G&lt;=4700)] = P[7] 
  
  
  fig = plt.figure(figsize=(12,10)) 
  
  plt.plot(G,P_y)      
  
  plt.vlines(3500,0,50,'red')
  plt.title('Curva de oferta agregada')
  plt.xticks([0,300,800,1800,2200,3600,4100,4700]) 
  plt.yticks(P) 
  plt.ylabel('USD/MW')
  plt.xlabel('USD') 
  
  plt.text(110, 22, 'G5', fontsize=9)
  plt.text(500, 33, 'G1', fontsize=9) 
  plt.text(1250, 42, 'G2', fontsize=9) 
  plt.text(1950, 45, 'G3', fontsize=9) 
  plt.text(2900, 51, 'G4', fontsize=9) 
  plt.text(3800, 71, 'G6', fontsize=9) 
  plt.text(4350, 101, 'G7', fontsize=9)  
  
  plt.grid()
  # plt.savefig('Curva.eps', format='eps')
  plt.show() 
  </code></pre>
  <p>I appreciate the help.</p>