I'm looking to be able to change the colours of lines to ones that I specify on a plot using matplotlib.
Below is the relevant code (it's part of a function) that I'm using. The variable avg_rel_track
is a '2D array' and each column corresponds to a 'blade'. Each 'blade' plots a separate line.
I would like each blade/line to be a colour I specify. I'm struggling to find the relevant documentation, and I'm sorry if it's obvious.
def plot_data(avg_rel_track, sd_rel_track_sum, shade):
fig = plt.figure(figsize=(18,10))
gs = gridspec.GridSpec(5, 1, height_ratios=[1.75, 1 ,1, 1])
ax0 = plt.subplot(gs[0])
ax1 = plt.subplot(gs[1])
ax2 = plt.subplot(gs[2])
ax3 = plt.subplot(gs[3])
ax4 = plt.subplot(gs[4])
fig.subplots_adjust(top=0.93)
#The following plot has 5 plots within it.
lineObjects = ax0.plot(avg_rel_track_nan)
ax0.set_title('Averaged Relative Track',fontsize=11)
ax0.legend(lineObjects, (1,2,3,4,5),loc='lower center', bbox_to_anchor=(0.82, 1),
fancybox=True, shadow=True, ncol=5)
Below is an example of the plot (Very rough)I would like to change the plots to what I specify. It is a crop out of 5 subplots