Matplotlib automatic legend outside plot [duplicate]

EDIT: I HIGHLY RECOMMEND USING THE ANSWER FROM ImportanceOfBeingErnest: How to put the legend outside the plot EDIT END This one is easier to understand: import matplotlib.pyplot as plt x = [1,2,3] plt.subplot(211) plt.plot(x, label=”test1″) plt.plot([3,2,1], label=”test2″) plt.legend(bbox_to_anchor=(0, 1), loc=”upper left”, ncol=1) plt.show() now play with the to coordinates (x,y). For loc you can use: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)