This should be easy, but I haven’t gotten the hang of Python syntax yet. I create an array like this:
colors = [ [(17.0/256.0), (15.0/256.0), (48.0/256.0)], #Dark blue (#110F30)
[(239.0/256.0), (83.0/256.0), (25.0/256.0)] #Orange (#EF5319)
]
I the want to use the first or second row as a color input in the plot statement:
ax1.plot(time, temp - 273, color=colors[0,:], label=temp_axis_label)
However, this does not work (obviously). What is the correct syntax to extract the rows from the color matrix?
Simply :
ax1.plot(time, temp - 273, color=colors[0], label=temp_axis_label)The problem lies in the fact that colors is a list of list, not a numpy matrix
:
works too.