如何在 x = 1 到 1000 范围内的 python 中创建 y = log10(x) 图?

How can I create a y = log10(x) plot in python in range x = 1 to 1000?

我正在尝试在 Jupyter notebook 中绘制 y = log10(x) - squareroot(x),x 在 1 到 1000 的范围内,有什么想法吗?

import math
import matplotlib.pyplot as plt
x = [i for i in range(1,1001)]
y = [math.log10(i)-math.sqrt(i) for i in x]
plt.plot(x,y)