plt.bar(x, y1, label="HR", color="#14342B") plt.bar(x, y2, bottom=y1, label="Engineering", color="#60935D") plt.bar(x, y3, bottom=y1 + y2, label="Marketing", color="#BAB700") plt.bar(x, y4, bottom=y1 + y2 + y3, label="Sales", color="#F5E400") plt.title("[DO] Employee Count Per Location And Department", loc="left", fontdict={"weight": "bold"}, y=1.06) plt.xlabel("Office Location") plt.ylabel("Count") plt.legend(loc="upper right", ncol=4) plt.ylim(top=320) plt.show()