Python 在Matplobliblib中拆分图例

Python 在Matplobliblib中拆分图例,python,matplotlib,legend,Python,Matplotlib,Legend,是否有可能将一个大的传奇拆分为多个(通常为2个)较小的传奇 from pylab import * t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) plot(t, s, linewidth=1.0, label="Graph1") grid(True) s = sin(4*pi*t) plot(t, s, color='r',linewidth=1.0, label="Graph2") legend(loc='lower left') show()

是否有可能将一个大的传奇拆分为多个(通常为2个)较小的传奇

from pylab import *

t = arange(0.0, 2.0, 0.01)
s = sin(2*pi*t)
plot(t, s, linewidth=1.0, label="Graph1")
grid(True)
s = sin(4*pi*t)
plot(t, s, color='r',linewidth=1.0, label="Graph2")

legend(loc='lower left')
show() 
我想将图例一分为二,并将它们放在有空白的地方。

我从

在这里,唯一的缺点是我必须给标签名两次

from pylab import *

t = arange(0.0, 2.0, 0.01)
s = sin(2*pi*t)
p1, = plot(t, s, linewidth=1.0, label="Graph1")
grid(True)
s = sin(4*pi*t)
p2, = plot(t, s, color='r',linewidth=1.0, label="Graph2")

l1 = legend([p1], ["Graph1"], loc=1)
l2 = legend([p2], ["Graph2"], loc=4)
gca().add_artist(l1)

show()