This is the image I want to create, however, it should have three legends corresponding to the bars.
This is the code:
import numpy as np
import matplotlib.pyplot as plt
x=[1,2,3]
y=[399,499,100]
LABELS = ["node0", "node1", "failed"]
cr = ['g','r','b']
fig,ax = plt.subplots()
ax.bar(x,y,align='center',color=cr, Label='txed, rxed, failed')
plt.xticks(x, LABELS)
plt.legend()
plt.show()