且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在matplotlib中绘制内嵌线标签?

更新时间:2023-11-09 20:36:28

我可以为您的问题建议另一种解决方案.由于在您的案例中,图例与图表重叠,因此您可能只想将图例移出绘图.

May I suggest another solution to your problem. Since in your case legend overlaps the charts you might just want to move the legend outside of the plot.

将图例移出情节的方法在此处进行了描述: 将matplotlib图例移到外部的轴使其被图形框切断

Method do move legend outside of plot is described here: Moving matplotlib legend outside of the axis makes it cutoff by the figure box