This post shows how to put the matplotlib's legend out of the plot and want to set this code as a default.
ax.legend(loc='center left', bbox_to_anchor=(1.0, 0.5))
matplotlib documentation shows a way to set loc
but not bbox_to_anchor
.
mpl.rcParams['legend.loc'] = 'center left' # this works
mpl.rcParams['legend.bbox_to_anchor'] = (1.0, 0.5) # this does not work
Is there a way to achieve this?