, "" . . , , - . :
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
N_points = 10
x = np.arange(N_points, dtype=float)
y = x
z = np.random.rand(N_points)
t = x
fig = plt.figure()
ax = fig.gca(projection='3d')
t /= max(t)
for i in range(1, N_points):
ax.plot(x[i-1:i+1], y[i-1:i+1], z[i-1:i+1], c=(t[i-1], 0, 0))
plt.show()

. 2 , . .
c = (t[i-1], t[i-1], t[i-1])
:
from itertools import cycle
colors = cycle('bgrc')
for i in range(1, N_points):
ax.plot(x[i-1:i+1], y[i-1:i+1], z[i-1:i+1], c=colors[t[i-1]])
plt.show()
, , .