【发布时间】:2015-03-10 15:39:36
【问题描述】:
我有两个图例,如下图,我发现我无法拖动第一个图例,这是什么问题?如何处理?谢谢!
import matplotlib.pyplot as plt
fig1, ax1 = plt.subplots()
ax2 = ax1.twinx()
ax1.plot([1,2,3],[0.1,0.82,0.3],'y*', label="one")
ax2.plot([1,2,3],[5,6,7],'ro', label="two")
leg1 = ax1.legend()
leg2 = ax2.legend()
leg1.draggable(state=True)
leg2.draggable(state=True)
plt.show()
【问题讨论】:
标签: python matplotlib plot legend