Search code examples
pythonjupyter-notebooklogarithm

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


I'm trying to plot y = log10(x) - squareroot(x) in Jupyter notebook with x in range 1 to 1000, any ideas?


Solution

  • 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)