import math
import matplotlib.pyplot as plt
x = [i * 0.001 for i in range(1, 1000)] # 0.001〜1
y = [(1+(1/i))**i for i in x]
z = [1+i for i in x]
w = [1-i for i in x]
plt.scatter(x, y, s=0.1, color="blue", label="y = x × sin(π / x)") # sは点の大きさ
plt.plot(x, z, color='red', linestyle='--', label='y = x')
plt.plot(x, w, color='red', linestyle='--', label='y = -x')
plt.title("散布図版: y = e")
plt.xlabel("x")
plt.ylabel("y")
plt.legend()
plt.grid(True)
plt.show()
To embed this project on your website, copy the following code and paste it into your website's HTML: