0
我正在使用foll。代碼在python熊貓中繪製圖例,但它沒有正確顯示:在python熊貓中錯誤地放置圖例
# Create plot
fig = plt.figure()
plt.rc('legend',**{'fontsize':8})
ax = df.resample('M', how='mean').plot(colormap=cols)
# Create a legend with transparent box around it
leg = plt.legend(fancybox = None, bbox_to_anchor=(0.5, -0.02), ncol=3)
leg.get_frame().set_linewidth(0.5)
leg.get_frame().set_alpha(0.5)
ax.set_ylabel('Percentiles')
# Place legend in right place and output
fig.subplots_adjust(bottom=0.2)
我該如何解決這個問題?我希望傳說在情節之外,但可以看到,而不是部分切斷。
謝謝!有沒有辦法讓它居中對齊?而不是目測bbox_to_anchor參數? – user308827