环境
Python3
Mac os
代码
# coding:utf-8"""Author: roguesirDate: /8/30GitHub: Blog: /roguesir"""import numpy as npimport matplotlib.pyplot as plth0 = [0.4,.6,.8] # h0取值lambda0 = [0.03,0.05,0.07] # λ取值plt.figure(figsize=(6,4)) # 设置图片大小x = np.linspace(0, 50, 50) # 在[0,50)中取50个点for i in lambda0:for h in h0:plt.plot(x, 11+(20*np.exp(-i*x)-h*x)/2,label='lambda='+str(i)+' h='+str(h))# plt.plot(x,y,图例内容)plt.legend() # 显示图例plt.show() # 显示画图