I'm fairly new to Python and I've come up with an issue on a plot. Can someone explain why this line graph would connect this way? It seems like I am missing a key step in sorting the variables.
To clarify, if the data was set up in this fashion, how would one get a line graph with the points (1,2) moving diagonal to (2,5), down diagonal to (3,1) and then moving up to (4,2) and (5,4)?
import matplotlib.pyplot as plt
a = [3,1,5,4,2]
b = [1,2,4,2,5]
plt.plot(a, b)

aas the x-coordinate andbas the y-coordinate... it is taking (a[0], b[0]) as the first coordinate and so on.... What are you trying to plot?