#绘制函数y=sinx/x的图像 import matplotlib.pyplot as plt import numpy as np #准备图的数据源,array([0,1,2,3,4,5,6,7,8,9]) x_ranges = np.arange(0, 20, 0.01) # figure1 = plt.figure(figsize=(10, 10)) ax1 = figure1.add_subplot(1, 1, 1) plt.title("y = sin(x)/x") plt.xlabel("X") plt.xlim([0, 20]) plt.ylabel("Y") plt.ylim([-2.5, 2.5]) plt.plot(x_ranges, np.sin(x_ranges)) plt.show()
绘制函数y=sinx/x的图像
最新推荐文章于 2025-05-11 08:42:46 发布