Matplotlib:添加label

代码

import numpy as np
import matplotlib.pyplot as plt
...
plt.title('money-tax-bonus-salary')
plt.xlabel('money')
plt.ylabel('tax/bonus/salary')
plt.plot(moneyList,minTaxList,label='min tax')
plt.plot(moneyList,minSalaryList,label='min salary')
plt.plot(moneyList,maxSalaryList,label='max salary')
plt.plot(moneyList,minBonusList,label='min bonus')
plt.plot(moneyList,maxBonusList,label='max bonus')
pl.legend()
plt.show()

效果图

Matplotlib:添加label_第1张图片
summary.png

你可能感兴趣的:(Matplotlib:添加label)