title: Why Matplotlib draws a straight line from last value to the x-axis in a loglog() plot?
body: <p>I am trying to use a loglog plot for my dataset, but I want my plot lines end at the last y-value for each set, but matplotlib completes the loglog plot to the x-axis with a straight line, see it <a href="https://i.stack.imgur.com/0HzSq.png" rel="nofollow noreferrer">here</a>.</p>
  
  <p>But I want my plot to be like <a href="https://i.stack.imgur.com/KXduN.png" rel="nofollow noreferrer">this</a>, ending at the exact end values.</p>
  
  <p>I have same array for x-axes, but 4 different y-values, so I plot my graph like this:</p>
  
  <pre><code>plt.loglog(x,y1,x,y2,x,y3,x,y4)
  </code></pre>
  
  <p>I create my y arrays from txt file like this:</p>
  
  <pre><code>with open(os.path.join(root,name),'r') as fin:
      y1 = []
      for q in fin:
          y1.append(float(q.split(' ')[1]))
  </code></pre>
  
  <p>How can I remove zero values from y1 array?</p>
  
  <p>Values go like this:</p>
  
  <pre><code>1 0.535025
  2 0.116237
  4 0.0336809
  8 0.00814949
  16 0.00159025
  32 0.000202602
  64 1.00662e-05
  128 7.68864e-08
  256 0
  512 0
  1024 0
  2048 0
  4096 0
  8192 0
  16384 0
  </code></pre>