on-internet
← Community

Line colour of 3D parametric curve in python's matplotlib.pyplot

Stack Overflow ·

I've been googling quite some time with no success ... maybe my keywords are just lousy. Anyway, suppose I have three 1D numpy.ndarrays of the same length I'd like to plot them in 3D as a trajectory. Moreover, I'd like to be able to do either of the following things: Change the colour of the line as a function of z Change the colour of the line as a function of time (i.e. the index in the arrays) This demo has an example of making such a curve: import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.pyplot as plt fig = plt.figure() ax = fig.gca(pro

Comments

Sign in or sign up to comment and upvote.

No comments yet.