0

I have plotted two columns from a csv file using plt.plot and have achieved the following graph:

enter image description here

The code for the graph is the following:

plt.plot(x, y, linewidth=0.50)

I have another column within the same csv file that contains the time for each of the x and y values. The time column looks like this:

Time,
1000,
2000,
3000,
4000,
5000,
6000,
7000,
etc...

I want to impose the time column to act as the color-code for the lines so that they can be coloured according to the time. I have tried this with a scatterplot and it works great...

enter image description here

...by tweaking the code to this...

plt.scatter(x, y, c=-x, s=10)
plt.gray()

...but I can't get it to work with a normal line plot.

LuvCode
  • 29
  • 6

0 Answers0