it seems to me like theres many different axes and axis objects hanging around in matplotlib and im finding it hard to figure out whats what. this code here is doing what i want but all the plots are going over eachother in the first subplot. i thought that you could access ax with indexes to pick which subplots to put each graph in but this gives me:
'AxesSubplot' object is not subscriptable
here's the code, plot contains[x, y, colour for each bar]
def display(subplots):
fig = plt.figure(facecolor='black')
ax = fig.add_subplot(1, 3, 1)
ax.set_facecolor((0,0,0))
ax.spines['bottom'].set_color('white')
ax.spines['top'].set_color('white')
ax.spines['left'].set_color('white')
ax.spines['right'].set_color('white')
ax.xaxis.label.set_color('white')
ax.tick_params(axis='x', colors = 'white')
ax.tick_params(axis='y', colors = 'white')
for plot in subplots:
plt.barh(list(plot[0]), plot[1], color = plot[2])
this is the only way I know of to be able to change all the colours of specific parts of the display but seems to be unable to access subplots. can someone explain what ax and fig are in this example and how i would be able to plot into each individual subplot.