0
我想设置图例中的绘图数据。pylab绘图图例错误
但我的代码似乎有错误。 我有以下的错误,在这里我设置一个传奇的情节线:
a.set_transform(self.get_transform())
AttributeError: 'NoneType' object has no attribute 'set_transform'
我的代码如下:
import numpy as np;
from pylab import *;
newData = np.array([[1,2],[2,3],[3,4]])
Action = 'abc'
line1 = 'class 0-' + Action
line2 = 'class 1 -others'
plot(newData[:,0],newData[:,1],'-')
figlegend((line1, line2),('*', '-'),'upper right')
hold(True)
plot(newData[:,1],newData[:,0],'*')
grid(True)
show()