import math
import matplotlib.pyplot as plt

if __name__ == '__main__':
    x=[float(i)/100.0 for i in range(1,300)]
    y=[math.log(i) for i in x]
    plt.plot(x,y,'r-',lineWidth=3,label='log curve')
    a=[x[20],x[175]]
    b=[y[20],y[175]]
    plt.plot(a,b,'g-')
    plt.plot(a,b,'b*',markersize=15,alpha=0.75)
    plt.xlabel('x')
    plt.ylabel('log(x)')
    plt.legend(loc='upper left')
    plt.grid(True)
    plt.show()

画图1

相关文章:

  • 2021-10-03
  • 2021-04-04
  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
  • 2021-09-02
  • 2021-04-27
  • 2021-04-06
猜你喜欢
  • 2021-12-01
  • 2022-01-19
  • 2022-12-23
  • 2021-08-22
  • 2021-10-22
  • 2021-07-23
  • 2021-08-30
相关资源
相似解决方案