one line - multiple colors

Hi all,

I was investigating archives, but I didn't find answer to my question.

I would like to plot the line which interconnects the GPS track points
(latitude and longitude coordinates) recorded by GPS receiver. It is
not so difficult. What I am not able to do is to change the color of
the line according to the speed reached on the way from point to
point. I would like to use the color of the line to differentiate the
speed as following:

speed <=50km/h
speed >50 and <=90km/h
speed >90 and <=130km/h
speed >130km/h

According to the matplotlib web: "If you make multiple lines with one
plot command, the kwargs apply to all those lines". So I am able to
set the different color arguments while plotting the tuple of the x and y points.

I would like to get something like following code:
(data is not real of course, it is for demonstration purposes only)

longitudes=[53.26,53.54,53.75,53.22]
latitudes=[18.56,18.72,18.93,18.12]
speeds=['r','g','y','r']
plot(latitudes,longitudes, speeds)
show()

Many thks for your suggestions.

Petr Jakes

Thanks a lot Eric,

your demo works excellent!

Petr