matplotlib设置legend坐标

使用plt.legend的loc参数。

plt.legend([str1, str2, str3], loc = [x, y])

其中x和y默认是百分比(写成0到1的小数),设定legend的左下角在图中的位置。

posted @ 2024-09-28 13:06  寻找繁星  阅读(11)  评论(0编辑  收藏  举报