I am plotting several curves as follow:
import numpy as np
import matplotlib.pyplot as plt
plt.plot(x, y)
where x
and y
are 2-dimensional (say N x 2 for the sake of this example).
Now I would like to set the colour of each of these curves independently. I tried things like:
plot(x, y, color= colorArray)
with e.g. colorArray= ['red', 'black']
, but to no avail. Same thing for the other options (linestyle, marker, etc.).
I am aware this could be done with a a for
loop. However since this plot
command accepts multi-dimensional x/y I thought it should be possible to also specify the plotting options this way.
Is it possible? What's the correct way to do this? (everything I found when searching was effectively using a loop)