Python-Matplotlib 14 图例legend

 

 

EG 1 

import numpy as np
import matplotlib.pyplot as plt

y = np.arange(1, 5)
plt.plot(y, y + 2, label='Normal')
plt.plot(y, y + 3, label='Fast')
plt.plot(y, y + 4, label='Faster')

plt.legend()    # hasn't this , can't show
plt.legend(['2','3','4']) # repeat set , will repace

plt.show()

  

posted @ 2017-02-22 10:44  ZSR0401  阅读(440)  评论(0编辑  收藏  举报