import matplotlib.pyplot as plt
import numpy as np
plt.rcdefaults()
fig, ax = plt.subplots()
# Example data
y_pos = np.arange(len(label_list))
performance = y3
error = np.random.rand(len(label_list))
rects3 = ax.barh(y_pos, performance, xerr=error, align='center')
ax.set_yticks(y_pos)
ax.set_yticklabels(label_list)
ax.invert_yaxis() # labels read top-to-bottom
ax.set_xlabel('Average test accuracy over 100 epochs%')
ax.set_title('Average performance for each model over 100 epochs')
def autolabel(rects):
for rect in rects:
width = rect.get_width()
plt.text(1.05*rect.get_width(), rect.get_y()+0.5*rect.get_height(),
'%d' % int(width),
ha='center', va='center')
autolabel(rects3)
plt.show()
Hi,
What is your question? Could you give more context on where you got this code from? What you’re trying to do and what is the issue?