title: python27 matplotlib: first and last element connected
body: <p>Hi I have found the same problem but without an answer:
  <a href="https://stackoverflow.com/questions/19540349/line-between-first-and-last-point">enter link description here</a></p>
  
  <p>My problem is that I try to plot data with the matplotlib and it connects the first and the last data point. I am using python27 and Windows 7. My problem is just to big to show complete so I just show some parts of the source code. The plot function is as below:</p>
  
  <pre><code>def plot(x, aw,temperature):
      plt.clf()
      temperatureplot = plt.subplot(211)
      awplot = plt.subplot(212)
  
      temperatureplot.grid()
      awplot.grid()  
  
      #set subplots
      awplot.set_ylabel('water activity aw')
      awplot.plot(x,aw)
      awplot.margins(y=0.05) #adds a gap between maximum value and edge of diagram
      temperatureplot.set_ylabel('Temperature in degree C')
      temperatureplot.plot(x,temperature)
      temperatureplot.margins(y=0.05)
  
      awplot.set_xlabel('Time in [hm]')
      plt.gcf().canvas.draw()
  </code></pre>
  
  <p>I am using this, because I am plotting this in a Tkinter Gui and want to refresh it sometimes. The plot looks like:
  <img src="https://i.stack.imgur.com/0ZYWN.png" alt="enter image description here"></p>
  
  <p>My values are:</p>
  
  <pre><code>t = [161000, 161015...., 191115]
  aw = [0.618,......, 0.532]
  temperature = [23.7,....,24.4]
  </code></pre>
  
  <p>Is it a problem that I do not start with zero in the t array? </p>
  
  <p>If anybody has a hint or knows the problem please help me.</p>
  
  <p>Cheers Max</p>