Python 绘制e^x,e^-x,e^x/x,e^-x/x,e-2x/x,e^-3x/x,ln(x)图像

陶鸿畴
2023-12-01

话不多说,直接上代码:

# -*- coding:utf-8 -*-
"""
author: 15025
time: 05.09.2021   05:27:21
software: PyCharm

Description:
    we will draw four figures here.
        1. draw figure of e^x and e^-x
        2. draw figure of e^x / x and e^-x / x
        3. draw figure of e^-x / x, e^-2x / 2x, e^-3x / 3x
        4. draw figure of ln(x)
        Note: In Python, np.log(x) means ln(x) in math

Comment:
    For task 3, with the increase of index, the speed of decreasing is up

"""
import numpy as np
import matplotlib.pyplot as plt
import warnings  # ignore divide by zero warning

war
 类似资料: