I have a understanding question about the lengend in matplotlib. Here is a code example how I plot two different plots with legend
plt.figure(3)
line1,=plt.plot(freq,numpy.sqrt(MX*MX+MY*MY))
line2,=plt.plot(freq,numpy.abs(STAA))
plt.xlabel('offset frequency / rad/s')
plt.ylabel('magnitude of trans. magnetization')
plt.legend([line1,line2], ['analytical solution','with approximation'])
plt.show()
line1,= creates a tuple with one element. My question is: what is the reason matplotlib needs a tuple here instead of a "normal" object? There must be some sort of benefit I am not aware of.
cheers, glostas