I would like to plot a 3xN matrix to obtain three lines, specifying the colors for each one. I can do this with three separate calls to plot():
fig = plt.figure()
theta = np.arange(0,1,1.0/720) * 2 * np.pi
abc = np.cos(np.vstack([theta, theta+2*np.pi/3, theta+4*np.pi/3])).T
ax = fig.add_subplot(1,1,1)
ax.plot(theta,abc[:,0],color='red')
ax.plot(theta,abc[:,1],color='green')
ax.plot(theta,abc[:,2],color='blue')
Is there a way to do the same thing, specifying colors with one call to plot()?
ax.plot(theta,abc,????)
I've tried
ax.plot(theta,abc,color=['red','green','blue'])
but I get ValueError: could not convert string to float: red in a callback.
