I came across matplotlib
code which customizes legend location using keywords loc
and bbox_to_anchor
. For example :
fig.legend([line1, line2], ['series1', 'series2'], bbox_to_anchor=[0.5, 0.5],
loc='center', ncol=2)
I have seen variation of above where bbox_to_anchor
is used after loc
.
I understand the purpose of using bbox_to_anchor
and loc
separately. However, is there any benefit of using both in the same legend specification? From my understanding and usage, it appears to me that if bbox_to_anchor
is specified, then the loc
parameter is pretty much don't care.
Can anyone confirm this? I don't see any documentation regarding this.