2

I am currently plotting a gps coordinates of an object and looking for a way to add a 3rd dimension to my plot by having the color of the plot line change as time passes. Because the plot goes in circles it is hard sometimes determine the starting position and the middle position. Is this possible in python? my current code looks like this:

fig1 = plt.figure(figsize= (10,10))
ax = fig1.add_subplot(311)
ax.plot(lat, long, label='GPS Cord', color = 'red')
plt.legend(loc='best',prop={'size':10})
plt.grid(True)

Sample of the data:

time, lat, long
5, 20, 30
6, 21, 29
7, 22, 28
8, 21, 29

EDIT: The link you posted has lines arbitrary fixed colored pattern. I am looking for a way to have it follow a time. Also I am very new to this so I had hard time following what was going on.

Jane Lee
  • 33
  • 4
  • https://stackoverflow.com/questions/17240694/python-how-to-plot-one-line-in-different-colors/17241345#17241345 also has some informative answers! – tacaswell Dec 21 '16 at 22:37

0 Answers0