title: How do I connect two sets of XY scatter values in MatPlotLib?
body: <p>I am using MatLibPlot to fetch data from an excel file and to create a scatter plot.</p>
  
  <p>Here is a minimal sample table</p>
  
  <p><a href="https://i.imgur.com/2xdJgiJ.png" rel="nofollow noreferrer"><img src="https://i.imgur.com/2xdJgiJ.png" alt="enter image description here"></a></p>
  
  <p>In my scatter plot, I have two sets of XY values. In both sets, my X values are country population. I have Renewable Energy Consumed as my Y value in one set and Non-Renewable Energy Consumed in the other set.</p>
  
  <p>For each Country, I would like to have a line from the renewable point to the non-renewable point.</p>
  
  <p>My example code is as follows</p>
  
  <pre><code>import pandas as pd
  import matplotlib.pyplot as plt
  
  excel_file = 'example_graphs.xlsx'
  
  datasheet = pd.read_excel(excel_file, sheet_name=0, index_col=0)
  
  ax = datasheet.plot.scatter("Xcol","Y1col",c="b",label="set_one")
  datasheet.scatter("Xcol","Y2col",c="r",label="set_two", ax=ax)
  ax.show()
  </code></pre>
  
  <p>And it produces the following plot</p>
  
  <p><a href="https://i.imgur.com/72IhDkz.png" rel="nofollow noreferrer"><img src="https://i.imgur.com/72IhDkz.png" alt="enter image description here"></a></p>
  
  <p>I would love to be able to draw a line between the two sets of points, preferably a line I can change the thickness and color of.</p>