I want to make a color-coded plot in python, but with lines instead of points. I used matplotlib and among others, these lines of code:
color_scheme = plt.get_cmap('spectral')
fig = plt.figure(figsize=(12,10))
gs = gridspec.GridSpec(1, 1)
ax1 = plt.subplot(gs[0])
im1 = ax1.scatter(bin_x, bin_y, c=red, edgecolors='black', marker='o', s=60, lw=1, cmap=color_scheme, vmin=0, vmax=10,zorder=1)
I want the same plot but to have straight lines instead of points, and the lines to be color coded as the points in the above plot. How can I do this?