How to put the legend out of the plot,ax.legend()