CHAPTER 03 · 作品已接入
标题与图例
用 title() 与 legend() 让多组数据易于辨识。
import matplotlib.pyplot as plt
plt.plot(x, y1, label='Series A')
plt.plot(x, y2, label='Series B')
plt.title('Title & Legend')
plt.legend(loc='upper right')
plt.show()
CHAPTER 03 · 作品已接入
用 title() 与 legend() 让多组数据易于辨识。
import matplotlib.pyplot as plt
plt.plot(x, y1, label='Series A')
plt.plot(x, y2, label='Series B')
plt.title('Title & Legend')
plt.legend(loc='upper right')
plt.show()