line, = ax.plot([1, 2, 3]) line.set_label('Label via method') ax.legend() ... The length of handles and labels should be the same in this case.
確定! 回上一頁