我正在尝试使用matplotlib为图例创建一个图例。我可以看到情节正在创建,但图像边界不允许显示整个图例。我的matplotlib.pyplot图例正在被切断
lines = []
ax = plt.subplot(111)
for filename in args:
lines.append(plt.plot(y_axis, x_axis, colors[colorcycle], linestyle='steps-pre', label=filename))
ax.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
这将产生:
[This answer](https://stackoverflow.com/a/43439132/4124317)概述了几种可用于使图例出现在图形边界内的技术。 – ImportanceOfBeingErnest 2017-10-11 22:03:45